When creating software, bugs sometimes slip through the cracks and you need tools to identify the root cause of the issue. To diagnose these in testing environments and the field you can generate a bug report from an Android device, which provides essential diagnostic outputs, including:
- Dumpsys: Diagnostic information for system services.
- Dumpstate: Logs of system errors.
- Logcat: System messages, including stack traces and log messages from all applications using the “Log” class.
- Systrace.txt: Tracks the execution time of app and system processes to evaluate performance.
There are several methods you can use to capture bug reports from your Android devices, including Android Studio, direct ADB connection with the "adb logcat" command, or the Esper console for enrolled devices.
1. Capturing a Bug Report Directly from an Android Device
1. Go to Settings > About Phone on the device.
2. Navigate to Software information.
3. Tap the Build Number seven times to enable Developer Options.
4. Open Developer Options and toggle it on.
5. Tap on Bug Report.
6. Choose from the following options:
- Interactive Report: Preferred for most cases, as it focuses on relevant sections and includes screenshots which make generation faster.
- Full Report: Offers a more comprehensive report across all sections but may take longer but there’s no option to include personalized insights or remarks from the admin or end user.
7. Tap Report to generate the bug report. It may take a few moments for a notification to appear.
8. Once complete, tap the notification to share the report via Drive or Gmail.
Note: The device must be signed into a Google account to share the report.
2. Capturing a Bug Report from an Android Emulator
One emulator option is available via Android Studio.
1. Open an Android Emulator and select the More (…) option.
2. An Extended Controls screen will appear.
3. Click the Bug Report tab.
4. Wait while the bug report generates and then click Save Report.
3. Capturing a Bug Report via ADB Command
Prerequisite: Install ADB on a computer and connect the device to your computer with a data enabled cable for your device's USB port type.
Open a terminal (Windows Command Prompt or Mac Terminal) and enter:
- Run the command “adb devices” to start the daemon and validate the device is connected to your computer. If successful you will see the following
- Note: “serial_number” should be the serial number of the connected device.
Run the command “adb bugreport Desktop”
This command saves the bug report to the specified Desktop/ location.
For multiple devices connected to the computer, use:
adb -s “serial_number” bugreport Desktop/
Structure of Bug Report Files and Folders
The generated bug report typically includes a structured set of files and folders that contain system diagnostics, logs, and performance metrics to help developers analyze and resolve application issues effectively.
How to generate the Bug report via Esper:
Capturing bug reports using Esper eliminates the hassle of physically connecting the device to a system or running complex ADB commands. It streamlines the entire process for administrators and ensures a seamless experience for end users. Here’s how Esper makes it easier:
- No Physical Connection Required
Traditional methods of generating bug reports often require the admin to have the device physically connected to a computer to execute ADB commands. With Esper, this is no longer necessary, as the entire process is managed remotely via the Esper console. - Simplified Workflow
Instead of asking end users to follow complicated steps to capture bug reports, the Esper console provides a one-click solution. Admins can request a bug report with a single click, minimizing the need for technical guidance. - End User Approval
For security and privacy, the end user receives a notification and must approve the request before the bug report is generated. This ensures transparency while respecting user consent. - Centralized Access to Reports
Once the bug report is captured, it is automatically available in the Esper console. Admins can easily access, review, and share the bug report for troubleshooting and issue resolution.
By leveraging Esper's intuitive interface, administrators save time and effort while ensuring that technical issues are documented efficiently. This approach not only accelerates troubleshooting but also enhances collaboration between teams, making device management smoother than ever.
Requesting for a Bug report:
Step 1: To request a bug report, go to Devices & Groups and locate the device. Then go to the Capture Logs tab.
Step 2: Click on Request Bug Report. A bug report request will be sent as a notification on the device.
Step 3: On the device, pull down to access the notification bar.
Step 4: Once the report is ready, the Share and Decline report options will be available in the notification bar.
Step 5: Click the notification to open up the following pop-up to share the report. Pressing Decline will end the process.
Step 6: Select Share to send the report to the console.
Step 7: Once the report is uploaded to the console, click Download to download and view the report.
Cancelling Bug Reports
Did you select the wrong device for a bug report? You can cancel a bug report from the device's Event Feed. Only bug reports that have a queued status may be canceled.
Go the the Event Feed and click on Cancel.
Summary
Bug reports are the backbone of creating reliable software and diagnosing issues as they arise.. They bridge the gap between users and developers, offering valuable insights into real-world scenarios that might be missed during development. A well-structured bug report not only saves time but also ensures quicker resolutions, leading to enhanced product quality and customer satisfaction.