Share several LOGCAT commands used by individuals when debugging Android

Source: Internet
Author: User

1. The system just after the machine, want to completely print out, then use Logcat, so it will be cached inside the print out;

2. If you do not want to print occupy terminal, then add a &, that is Logcat &

3. If you want to clear the front of the printing, start printing now, then use logcat-c; Logcat

4. If you want to filter out the tag in the code LOG.D (tag, "* * *") the keyword print, then use logcat-s tag. Tag is the string that you define yourself.

5. If you want to print a timestamp with a print, then logcat-v time, so that it is easy to track which point in time the problem, of course, can add parameters, such as Logcat-v time-s TAG

6. If you want to print output to a file, you can directly use Logcat-f/data/log.txt &,-F means that the specified file,& for background execution, of course, you can use the redirection > output to the file. Background execution needs to note that you can use PS L to list the PID of Logcat first, then kill-9 <pid > Delete it.

7. If the running process is not about logcat an APK has been hung up, the popup has stopped running, we can use this command to view the key error message: Logcat *:e, this will only filter out the previous error message with E.


Here I am just a point, hope that these can help the novice, but also hope that you will add some better command to communicate.


Original articles, welcome reprint, reproduced please specify: blog.csdn.net/jjzhoujun2010

Dream Fly


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.