Preface the new notebook E431 installed the latest version of Eclipse, the Android development environment, but the logcat to see only the level, there is no error detailed information. I am not a willing to toss the GUI, more like the operation of pure command line, so today in Minghao brother's proposal, decisively abandon eclipse Logcat, to the ADB shell execution logcat.
The ADB logcatandroid log system provides a LOGCAT command that lets us track and view the system log buffers. The basic syntax is as follows:
[ADB] logcat [<option>] ... [<filter-spec>]
You can view the log output directly at the command line by using the following command:
ADB logcat
You can also execute the following commands directly after logging into the development machine via the ADB shell:
Logcat
Option options
I generally use-s to perform tag tags, for example:
Advanced features in ROM porting or other debug occasions, you need to combine filtering function to get the information you really need from logcat, and then introduce logcat two kinds of filtering implementation methods.
Filtering adb Logcat provides additional functionality to filter logs based on the log priority level. Use the following syntax:
ADB logcat *:#
Among them, #为下列选项之一:
- V verbose, indicates all possible logs, default level
- D Debug, indicating all reasonable debug logs
- I information, which indicates the log when normal use
- W warning, indicates there may be a problem, but no error has occurred
- E error, indicates a problem, and causes an error
All priorities automatically contain a higher priority than it, such as Logcat *:i, which contains information, warnings, errors, and so on. Therefore, when the application crashes, it is more important to assemble logcat *:e to see the cause of the error, and it is necessary to look at the irrelevant debug logs.
grep for the output of the ADB logcat log content, we can also combine grep for further filtering operations. For example, I need to search for a log containing the "Wangzhengyi" keyword in the error report, which can be used as follows:
ADB Logcat *:e | Grep-i ' Wangzhengyi '