ADB logcat command to view and filter Android output log
CMD command line using the ADB logcat command to view the Android system and the application's Log,dos window press CTRL + C to interrupt the output log record.
Logcat Priority/tag tags in the log:
Each log of the Android output has a tag and priority associated with it.
The priority is the following character, in order from low to High:
V-Detail verbose (lowest priority)
-D Debug Debug
I-Info info
W-Warning warn
E-Fault Error
F-Critical Error fatal
S-No record silent
A token is a short string that identifies the source of the original message. The following is a log output message with a priority of "D", labeled "Powermanagerservice":
D/powermanagerservice (305): Onsensorchanged:light value:306.0
Use the Logcat command to view the Android log output:
ADB logcat//Show All logs
ADB logcat > C:\test.log//Save the log to a file Test.log
Filter log output based on tag tag and level:
Only the output is marked "Activitymanager" and the priority is greater than or equal to "Info" and the log marked as "Powermanagerservice" with a priority greater than or equal to "Debug":
ADB logcat activitymanager:i Powermanagerservice:d *:s
Note: *:s is used to set the log priority for all tags to s, which ensures that only eligible logs are output.
ADB logcat *:w//Show all logs with priority greater than or equal to "warning"
ADB logcat-s powermanagerservice//Display Powermanagerservice log information
Logcat Command list:
-D exit after displaying the log in the console
-C Clean up existing logs
-F <filename> Output the log to a file
ADB logcat-f/sdcard/test.txt
-V <format> set log Input format control output field, default is brief format
brief-Show priority/tag and PID of the original process (default format)
process-Show only Process PID
tag-only show priority/tag
thread-Show only processes: threads and priorities/tags
raw-Display the original log information, no other metadata fields
time-display date, call time, priority/tag, PID
long-display all metadata fields and separate message contents with blank lines
ADB logcat-v thread//using the thread output format
Note Only one format can be specified in the-v option.
-B <buffer> Loads a log buffer that can be used for viewing, and the default value is main.
radio-viewing buffer messages that are contained in a wireless/phone-related
events-viewing event-related messages
main-Viewing the primary buffer (default buffer)
ADB logcat-b Radio//View radio buffers
Reprint Please specify source: 6san.com
Original address: http://www.6san.com/1049/
ADB logcat command to view and filter Android output log