1. Home
  2. Android
  3. Power button bug report

How to enable the Android power button bug report

Developing for a mobile platform, whether it’s a website or an app, requires accessing a device’s log. The log offers information about the web and API calls that are being sent and received, and it also offers information about the device and how it is interacting with an app or website.

For Android, a device log is normally obtained by connecting the device to a desktop system. The process isn’t complicated but it ties you to a desktop system which is inconvenient.

Device log on Android phones

A device log doesn’t necessarily have to be generated from a desktop system. An Android phone is able to generate a complete device log all on its own.

Starting from Android 10, and onwards, there is a built-in option to generate a bug report which includes a complete device log. This option has to be enabled before it can be used.

1. Enable developer options

The Android power button bug report option is enabled from Developer options which have to be enabled themselves.

  1. Open the Settings app on your Android device.
  2. Go to System.
  3. Look for the build number here. Its location may differ based on your device.
  4. Tap the build number seven times. You will see a notification telling you that Developer options have been enabled.

2. Enable USB debugging

Once you’ve enabled Developer Options, you must now enable USB debugging. 

  1. Open the Settings app on your Android device.
  2. Go to System>Developer options. Developer options may be under a different setting depending on your device.
  3. Look for the USB Debugging switch and turn it on.

3. Enable Power button bug report

Once you’ve enabled USB debugging, you can enable the power button bug report option.

  1. Open the Settings app on your Android device.
  2. Go to System>Developer options.
  3. Turn on the ‘Bug report shortcut’ switch.

4. Capture bug report

Now that the bug report shortcu has been enabled, you can use it to capture a bug report.

  1. Open the app or website that you want to generate a bug report for.
  2. Press and hold the power button on your Android device.
  3. The power button menu will show Bug Report button. Tap it.
  4. You will see a ‘Bug report is being generated’ notification.
  5. Use the app/navigate the website until you encounter a bug.
  6. Open the Notifications dropdown, and check if the progress bar under the bug report notification is complete.
  7. Once the progress bar is complete, tap it, and select how you want to share the bug report.

5. Access bug report on device

If you want to access a bug report on your device, you can do so from the Settings app.

  1. Open the Settings app on your Android device.
  2. Go to Storage>Files.
  3. Tap the hamburger icon at the top left.
  4. From the navigation drawer, select Bug Reports.
  5. Go through the various bug reports, and tap the one you want to view.

6. Customize bug report

An Android device can generate two types of bug reports; an interactive bug report which is a more concise report, and a Full report which includes everything. You can choose between the two which type you want to generate.

  1. Open the Settings app on your Android device.
  2. Go to Developer Options.
  3. Tap Bug Report.
  4. From the pop-up, select the type of bug report you want to generate.
  5. The setting will apply to all future bug reports that you capture.

What’s in a bug report?

A bug report generated on an Android device may simply be a text file, or it may be zipped folder that contains multiple files.

Normally, a bug report will contain;

  • A bug report file.
  • A dump log file.
  • A folder with logs of which sensors on the device were used, and other hardware related logs.
  • A folder called FS which contains information about the file system.

Android bug report vs Device log

The Android bug report will contain the same information you obtain when you generate a device log via ADB tools. The only difference is, with ADB tools, you have to issue a command for the type of information you want to capture. The bug report generated on Android automatically captures all this information.

Bug reports can be exceptionally small in size e.g. single digit MB files, or they can be much larger. It depends on how much information was captured.