Tech Blog

Android, Testing

Generate Bug Report on Android Devices

By Sandeep Kadam3 min read
← Back to blog

A bug or issue in software can cause the system to fail or behave in an unintended way. It is very important for an app developer to identify and fix these bugs early in the software development life cycle. 

In order to troubleshoot the bug, the app developer needs a bug report from the Android device which contains dumpsys (diagnostic output for system services), dumpstate (error logs), and logcat (system message logs). Logcat messages include the stacktraces and the messages written from all apps with the “Log” class. The bug report also contains a ​​systrace.txt file, which captures and displays the execution time of your application processes and other system processes in order to analyze the performance of the app under test.

There are many ways of collecting bug reports from Android devices such as collecting from Android Studio, by execution of the “adb logcat” command via shell. 

Below are the 3 methods of capturing bug reports

1. Capturing a bug report from a device.

  1. Take an Android device and navigate to “Settings > About Phone”.
  1. Tap 7 times on the “Build Number” to enable “Developer Options”.
  1. Go to “Developer Options” and  toggle it on.
  1. Tap on “Bug Report”.
  1. Select any of the following options
    1. Interactive Report – This is preferred in most cases as it generally ignores the less used sections which take more time to report. This has more details about the problem and it takes screenshots as well.
    2. Full Report – These are useful when you need a comprehensive report covering all sections. This does not allow you to enter more details and takes  additional screenshots.
  1. Tap on “Report”.

This creates a notification and starts generating the bug report. The progress of the status will be shown in the notification. It might take a few minutes to complete this activity.

  1. Once the bug report is generated, tap to share your bug report.
  2. You can choose the “Drive” or “Gmail” to share your report with the app developer. 

Note: The device must be signed into a Google account in order to share the report.

2. Capturing the bug report from an Android Emulator.

  1. Open an Android Emulator and Click on the “More (…)” option.
  1. It will open the “Extended Controls” screen of the emulator.
  1. Click on the “Bug Report” tab. 
  1. Wait until the bug report collection is complete. Then click on the “Save Report” button and save the bug report.

3. Capturing the bug report through ADB command. 

Prerequisite: To generate the bug report through the ADB command requires you to install ADB on a connected computer.

  1. Connect the device under test to the computer and execute the following ADB command from cmd (in Windows) or terminal (in mac).

adb bugreport Desktop/

Desktop/ – This is the path where the Bug report is saved. 

  1. The bug report will be saved in Desktop/

Note: If there are multiple devices connected to the computer, then execute the following ADB command

adb -s “serial_number” bugreport Desktop/

Note: “serial_number” should be the serial number of the connected device. The serial number can be found by executing the following ADB command.

adb devices

Below are the files and  folders structure of the bug report. 

Keep reading

You may be interested in

Browse all articles →
Introduction to Cookie Testing
September 21, 20225 min read

Introduction to Cookie Testing

1.Cookie Testing is mainly used to test the cookies that are saved in the web browser.2.When ever a web application is being accessed by the use of a server then The term cookie can be defined as the portion of data saved in the form of text in the browser history.3. It is used to […]

By Lokesh CheekurthiRead More →
Generate DumpState logs On Samsung Android Devices
June 23, 20223 min read

Generate DumpState logs On Samsung Android Devices

Capture dumpstate logs on the Samsung devices: An issue or bug in software can cause the system to fail or behave in an unintended way. Whenever a critical issue is observed or found by the QA team, it is important for them to reproduce the issue and share the required logs with the app developers […]

By Sandeep KadamRead More →
Android Download file with Data URL
July 23, 20241 min read

Android Download file with Data URL

What is a Data URL? Data URLs are the type of URL scheme that is used to embed usually small types of files. In this URL, inline files are prefixed with the data: MIME type. data:[<mediatype>][;base64],<data> To download files having Data URLs inside Android: Firstly, we need to get an extension of the file from […]

By Bansari PanditRead More →