Android gets the crash log (adb logcat or dropbox)

1. Obtain through adb logcat :

Usage scenario : testing or developing small partner crawling.

Execute first adb logcat -cto clear the cache log

Next, grab the logs starting from the current time period:
adb logcat -v time >D:/crash.log
you can also grab the logs of the specified process:
adb logcat -v time | find "com.xxx" >D:/crash.log

Among them -v, and timerefer to the v-level log of the log, and w can also be used to indicate the warning level, and time is the output time.

Finally, execute Ctrl + C to end the crawl.

2. Obtain the crash log recorded by the system through dropbox :

Usage scenario : When the scenario cannot be reproduced, or adb logcat cannot capture it, you can view the crash recorded by the system through dropbox.

Android DropBox is a management class used by Android to continuously store system data. It
is mainly used to record the log when serious problems occur during Android operation, kernel, system process, user (app) process, etc. It can be regarded as a system-level logcat for sustainable storage.

Use dropbox to view the list of various abnormal logs recorded: adb shell ls -al /data/system/dropbox, some devices will prompt that there is no permission.

Print the content output of multiple files under dropbox to the specified file:
adb shell dumpsys dropbox --print >>D:\dropbox\crash.log

Open the crash file and find the crash information according to the time point
insert image description here
: Through the log, it is easy to judge whether the crash is caused by the system process or the app process itself

Process crash type in the dropbox log file:

system_server_anr: The system process has no response
system_server_watchdog: The system process has a watchdog
system_server_crash: The system process has crashed system_server_native_crash :
The system process native has crashed
system_server_wtf: The system process has a serious error
system_server_lowmem: The system process has insufficient memory
Of course, in addition to the system_server process, there are also system_app and data_app types of processes. system_app_anr: System app is not responding data_app_crash: Normal app is crashing data_app_anr : Normal app is not responding



For more analysis, please read https://wizzie.top/android/android_dropbox/

おすすめ

転載: blog.csdn.net/hexingen/article/details/130421006