How to create Bugreports and Logcat with ADB in Android

You can save the bugreport log to a file with the adb command and download it to your PC.

1. adb bugreport FILENAME.zip

The following command extracts the bugreport log and downloads the compressed log file to your PC as bugreport.zip.

$ adb bugreport bugreport.zip
/data/user_de/0/com.android.shell/files/bugreports/bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-21-42.zip: 1 file pulled, 0 skipped. 362.0 MB/s (4358364 bytes in 0.011s)
Bug report copied to bugreport.zip

Under the hood, the file is saved in the path /data/user_de/0/com.android.shell/files/.. when the command is done.

$ adb shell ls /data/user_de/0/com.android.shell/files/bugreports/bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-21-42.zip
/data/user_de/0/com.android.shell/files/bugreports/bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-21-42.zip

And it will be downloaded to your PC as bugreport.zip automatically.

$ ls
bugreport.zip

2. adb bugreport

adb bugreport extracts the log, compresses it, and downloads the file to your PC without renaming it.

$ adb bugreport
/data/user_de/0/com.android.shell/files/bugreports/bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-27-25.zip: 1 file pulled, 0 skipped. 356.9 MB/s (4273454 bytes in 0.011s)
Bug report copied to /home/js/test/bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-27-25.zip

After the command is done, you can see the file on the PC and the file name is determined based on the time.

$ ls
bugreport-sdk_gphone_x86_arm-RSR1.201013.001-2021-07-11-15-27-25.zip

Related Posts

codechachaCopyright ©2019 codechacha