Skip to content
space2 edited this page Sep 28, 2012 · 4 revisions

HOME > How to use it

Just run the tool passing the bugreport as parameter.

I use the wrapper script, copied both of the them (the wrapper script "chkbugreport" and the jar file "chkbugreport.jar") to $HOME/bin/, so then from anywhere on my computer I can use it like this:

$ chkbugreport thebugreport.txt

But of course you can use the jar file as well:

$ java -jar path/to/chkbugreport.jar thebugreport.txt

The bugreport can be compressed (as .gz or in a zip file) or plain text file. The tool will create a folder (with the input file's name and the "_out" suffix appended) and create all files under that folder (and some subfolders). You should open the "index.html" file from this folder (Chrome or Firefox highly suggested).

If you don't have a bugreport, create one:

$ adb bugreport > bugreport.txt

Also if you have only pieces of a bugreport (for example logs or stack traces), you can still use this tool. Suppose you have a system log and a file containing the process stacktraces (taken from /data/anr/traces.txt for example), you can use the tool like this:

$ chkbugreport -sl:the_system_log.txt -sa:traces.txt dummy

This will generate the output in the folder called "dummy_out" (it assumes "dummy" to be the name of the non-existing bugreport).

Note that chkbugreport has an extra functionality: it can process profiling data as well created for traceview. The result will be similar: a folder with a bunch of html and image files. To use it with tracefiles add the "-t" option on the command line:

$ chkbugreport -t something.prof

You can generate this profiling data like this:

  • Use "adb shell ps" to list all the process and find the PID of the process you want to trace
  • Execute "adb shell am profile PID start /data/profile.dat" to start profiling (replace PID with the process ID number)
  • Do the testing
  • Execute "adb shell am profile PID stop" to stop profiling (replace PID with the process ID number)
  • Pull out the file using "adb pull /data/profile.dat" and remove it from the phone (to save precious disk space): "adb shell rm /data/profile.dat"
  • Create the report "chkbugreport -t profile.dat"
# ##
Clone this wiki locally