Nosari20
Android Logging guide

Android Logging guide

Content

Android adb log

Purpose and content

Android adb logs contain all runtime data about applications and system processes. Log level can be specified and logs can be filtered.

ADB logs look like the following example:

ADB logs

How to gather adb logs

  1. Download android platform tools on https://developer.android.com/studio/releases/platform-tools
  2. Plug the device to computer using USB cable
  3. Turn on developer settings and enable USB debugging
Tap build number Enable dev options Enable usb debugging Allow usb debugging
  1. Use the following command line to ensure that the device is connected (a pop-up should appear on the device requesting user approval, select Always allow from this computer)
1
adb devices

ADB devices

  1. Clear old data
1
adb logcat -b all -c

ADB logcat clear

  1. Run logcat
1
adb logcat -v threadtime > android.log

ADB logcat

  1. Reproduce the issue
  2. Use CTRL + C to stop collecting logs

Logs are now all store in android.log

Usefull logact filters

PurposeCommand
Specific appadb logcat --pid=$(adb shell pidof "<PACKAGE_NAME>")
Wi-Fiadb logcat -s wpa_supplicant
Authadb logcat -s Auth

Bug report

Purpose and content

A bug report contains device logs, stack traces, and other diagnostic information. The bug report can be generated using adb or from the device Settings app.

A bug report look like the following example: ADB logs

How to generate a bug report using ADB

Important : reproduce the issue before collecting a bug report

  1. Download android platform tools on https://developer.android.com/studio/releases/platform-tools

  2. Plug the device to computer using USB cable

  3. Turn on developer settings and enable USB debugging

    Tap build number Enable usb debugging Enable usb debugging Allow usb debugginh

  4. Use the following command line to ensure that the device is connected (a pop-up should appear on the device requesting user approval, select Always allow from this computer)

1
adb devices

ADB devices

  1. Type the following command
1
adb bugreport

ADB logs

  1. The bugreport file name should look like bugreport-YYY-MM-DD-HH-MM-SS.zip

How to generate a bug report from device settings app

  1. Turn on developer settings
  2. Tap Bug report then Full report and finnaly Report
Take bug report Take bug report
  1. Tap the notification to share the bugreport file
Take bug report

Samsung dumpstate

Purpose and content

Samsung dumpstate is a specific set of log files that are always requested by Samsung support. The logs include the same data we can find in a bug report with aditional Samsung specific logs and data.

How to generate a dumpstate

  1. Open the phone app (for tablet open the Calculator app and type (+30012012732+ to open the prompt)
  2. Type *#9900#
  3. Tap Debug Level Disabled/LOW then tap MID (the device will reboot after this step)
  4. Reproduce the issue
  5. Open the phone app (for tablet open the Calculator app and type (+30012012732+ to open the prompt)
  6. Type *#9900#
  7. Tap Run dumpstate/logcat (the process will takes several seconds)
  8. Tap Copy to sdcard
  9. Tap 2 times the Home button to exit
  10. Open the application drawer and open the My Files app (often under the Samsung folder)
  11. Go to Internal storage > log
  12. The dumpState file name starts with dumpState

Do not forget to restore the log level

  1. Open the phone app (for tablet open the Calculator app and type (+30012012732+ to open the prompt)
  2. Type *#9900#
  3. Tap Debug Level Enabled/MID then tap LOW (the device will reboot after this step)

Sources / usefull resources