Reference article: http://blog.csdn.net/createchance/article/details/51954142
Google has developed the ADB bugreport tool to facilitate Android developers to analyze all the information that the entire system platform or app has been running for some time. Developers can use the ADB bugreport command to get all the log information that is running on the system. The command is as follows:
ADB bugreport > Bugreport_out.txt
All log information is output to the Bugreport_out.txt file.
Of course, getting the log information is only the first step. Because the Bugreport command will find that the generated file may have more than 10 m, parsing a txt file of more than 10 m is a nightmare. So Google has developed an analysis tool for more than 5.0 systems battery historian. Use this tool to parse the log file and display it as a Web diagram, as follows:
At present, Google has bettery historian Open source, open source project address:
Https://github.com/google/battery-historian
Battery Hitorian This tool is cumbersome to install, and if you want to switch to a different view, you can use the Sony Open source Chkbugreport tool, which is easy to use. Chkbugreport Open Source Address home:
Https://github.com/sonyxperiadev/ChkBugReport
The steps are as follows: 1, download Chkbugreport.jar
Download Chkbugreport.jar file in https://github.com/sonyxperiadev/ChkBugReport/wiki/Where-to-obtain-it
2. Get the System log information
ADB bugreport > Bugreport.txt
3. Parse log file
Execute the following command at the command line:
D:\temp>java-jar C:\Users\shiyunjin\Downloads\chkbugreport-0.5-215.jar D:\Temp\bugreport.txt
After executing this command, a Bugreport_out folder is generated in the current directory, which is the result of the analysis, as shown in figure:
You can view the index.html, where the log is categorized, as shown in the figure: