Capture and read bug reports


    Figure 1. Developer options

    To take a bug report, you must have enabled on yourdevice so you can access the Take bug report option.

    Capture and read bug reports - 图1
    Figure 2. The bug report is ready

    To get a bug report directly from your device, do the following:

    • Be sure you have DeveloperOptions enabled.
    • In Developer options, tap Take bug report.
    • Select the type of bug report you want and tap Report.
      After a moment you get a notification that the bug report is ready (see figure 2).

    • To share the bug report, tap the notification.

    • Click More in theemulator panel.
    • In the Extended controls window, select Bug report on the left.

    This opens a screen where you can see the bug report details such as the screenshot, the AVD configuration info, and the bug report log. You can also type a message with reproduction steps to save with the report.

    If you have just one device connected, you can get a bugreport using as follows:

    If you do not specify a path for the bugreport, it is saved tothe local directory.

    If you have multiple devices connected, you must specify the device with the-s option. Run the following adb commands toget the device serial number and generate the bug report.

    1. $ adb devices
    2. List of devices attached
    3. emulator-5554 device
    4. 8XV7N15C31003476 device
    5.  
    6. $ adb -s 8XV7N15C31003476 bugreport

    By default the ZIP file is calledbugreport-BUILD_ID-DATE.zip and itit may contain multiple files, but the most important file is. Thisis the bug report and it containsdiagnostic output for system services (dumpsys), error logs (dumpstate),and system message logs (logcat). The system messages include stack traceswhen the device throws an error, and messages written from all apps with theLog class.

    The ZIP file contains a metadata file that containsthe Android release letter, and when systrace is enabled, the ZIP file alsocontains a systrace.txt file. Thehelps analyze the performanceof your application by capturing and displaying execution times of yourapplication processes and other Android system processes.

    Capture and read bug reports - 图2

    Figure 3. Bug report file structure

    For more information, seeReading bug reports.

    Capturing bug reports as described above is helpful as you're using the appyourself, but your end-users can't easily share these types of bug reportswith you. To get crash reports with stack traces from real-world users,you should take advantage of Google Play's and Firebase's crash reportingfeatures.

    You can get reports from the to view data for crashes and application notresponding (ANR) errors from users who installed your app from Google Play.Data is available for the previous six months.

    For more information, seeView crashes & application not responding (ANR) errors in Play Console help.

    Firebase crash reporting

    You'll start receiving crash reports from any user by simply adding theFirebase dependencies to your build.gradle file. For more information, see.