• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. Debugging on Firefox OS
  5. Firefox OS crash reporting

Firefox OS crash reporting

In This Article
  1. Before you attempt anything else
    1. Installing BusyBox
  2. Getting crash reports from a Firefox OS device
  3. Getting crash IDs from the command line
  4. Getting/verifying the crash report
  5. How to Force a crash
    1. How to run GDB script for b2g

This page details how to handle crash reporting on Firefox OS, including retrieving crash reports, and forcing crashes.

Note: Most Firefox desktop contributors are used to using about:crashes to retrieve crash reports (read Crash reporting for more details), but this isn't supported on Firefox OS.

Before you attempt anything else

The following instructions assume that you have already followed these three steps:

  1. Make sure remote debugging is enabled on your device, and ADB is installed. This allows your computer to communicate with your device.
  2. Connect your device to your computer via USB.
  3. Install the ADB Helper Add-on on desktop Firefox to handle any necessary port forwarding.

Installing BusyBox

It is also recommended that you install our BusyBox utility, which adds a number of useful commands to ADB for helping to test and debug Firefox OS.

To install it, ensure your device is awake and then:

  1. Download BusyBox.
  2. Unzip the tarball in a sensible location.
  3. cd into the resulting busybox-b2g directory.
  4. Run ./install.sh to install.

All of the busybox utilities get symlinks in /system/bin, so you can run commands like ping directly. Here are some sample commands:

adb shell ping 8.8.8.8   => ping command
adb shell ifconfig wlan0 => check tx/rx bytes 
adb shell cat /proc/net/route    => check the default route
adb shell iptables -t nat -nvL   => check if the packets are sent from application to IP layer, check Chain OUTPUT (policy ACCEPT 2 packets, 168 bytes)

Getting crash reports from a Firefox OS device

We have created a Firefox OS app to allow us to retrieve crash reports — About Crashes — which works on version 1.2+.

To install it on your device, follow these steps:

  1. About Crashes is a certified app, so you need to enable debugging of certified apps (see instructions for App Manager, and WebIDE).
  2. Download the About Crashes app zip file from the above link and extract it locally.
  3. In Firefox desktop, open the App Manager or WebIDE (depending on which version of Firefox you are using) under Tools > Web Developer.
  4. In either tool, add the About Crashes app as a packaged app (App Manager: click on the plus next to the Add Packaged App option, WebIDE: Open the left hand dropdown menu and select Add Packaged App...).
  5. Connect your device to App Manager/WebIDE (App Manager: find it listed at the bottom of the UI, WebIDE: Find it under Select Runtime).
  6. Install and open the app on the device (App Manager: Press the app's Update button, WebIDE: press the "Play" button (Install and Run)).
  7. On the device, press the Update button inside About Crashes to see your most recent crashes.

Getting crash IDs from the command line

You can get a list of crash IDs via the command line by entering the following command into your terminal:

adb shell ls -l /data/b2g/mozilla/Crash\ Reports/submitted/

If you have a long list of crashes and want them sorted by date, use this command instead:

adb shell busybox ls -ltr /data/b2g/mozilla/Crash\ Reports/submitted/

Getting/verifying the crash report

To verify a crash report:

  1. Copy the filename without the extension.
  2. Go to Mozilla Crash Reports.
  3. Paste the filename without the extension into the upper right hand search box.

This should display the crash report you have submitted.

How to Force a crash

To trigger a Firefox OS system crash, enter the following command in your terminal to find out the root process ID:

adb shell ps | grep b2g

You'll need to find the line that has root at the start of it, and /system/b2g/b2g at the end. It should look something like this:

root 109 1 191120 66024 ffffffff 400fa330 S /system/b2g/b2g

The number at the start of the line is the kill process id you'll need to use to kill that process. Run the following command, with the id filled in where the placeholder is:

adb shell kill -11 [ENTER ID HERE]

Killing the root process will crash your device.

How to run GDB script for b2g

  1. Start the gallery app on the phone, then run the following command in your terminal:
    adb shell b2g-ps
  2. Note down the pid of the gallery app, then run the following command:
    ./run-gdb.sh attach <pid>
  3. Cause the crash.
  4. Run this command:
    (gdb) bt

Document Tags and Contributors

Tags: 
  • crash
  • crash reports
  • Debugging
  • Firefox OS
  • QA
  • Testing
 Contributors to this page: chrisdavidmills, SteveOfTheStow
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:59:46 AM
See also
  1. Build and install
    1. Build and install overview
    2. B2G OS build process summary
    3. Build prerequisites
    4. Preparing for your first build
    5. Building B2G OS
    6. B2G installer add-on
    7. Building B2G OS for Flame on Mac OS X
    8. Choosing how to run Gaia or B2G OS
    9. Compatible Devices
    10. Installing B2G OS on a mobile device
    11. Creating and applying B2G OS update packages
    12. Building and installing FOTA community builds
    13. B2G build variables reference sheet
  2. Porting B2G OS
    1. Porting overview
    2. Porting basics
    3. Porting on CyanogenMod
  3. Developing Gaia
    1. Developing Gaia overview
    2. Running the Gaia codebase
    3. Run Gaia on desktop using Mulet
    4. Understanding the Gaia codebase
    5. Making Gaia code changes
    6. Testing Gaia code changes
    7. Submitting a Gaia patch
    8. Gaia build system primer
    9. Different ways to run Gaia
    10. Make options reference
    11. Gaia tools reference
  4. B2G OS APIs