This article needs a technical review. How you can help.
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:
- Make sure remote debugging is enabled on your device, and ADB is installed. This allows your computer to communicate with your device.
- Connect your device to your computer via USB.
- Install the ADB Helper Add-on on desktop Firefox to handle any necessary port forwarding.
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:
- Download BusyBox.
- Unzip the tarball in a sensible location.
- cd into the resulting busybox-b2g directory.
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 188.8.131.52 => 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:
- About Crashes is a certified app, so you need to enable debugging of certified apps (see instructions for App Manager, and WebIDE).
- Download the About Crashes app zip file from the above link and extract it locally.
- In Firefox desktop, open the App Manager or WebIDE (depending on which version of Firefox you are using) under Tools > Web Developer.
- 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...).
- Connect your device to App Manager/WebIDE (App Manager: find it listed at the bottom of the UI, WebIDE: Find it under Select Runtime).
- Install and open the app on the device (App Manager: Press the app's Update button, WebIDE: press the "Play" button (Install and Run)).
- 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:
- Copy the filename without the extension.
- Go to Mozilla Crash Reports.
- 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
- Start the gallery app on the phone, then run the following command in your terminal:
adb shell b2g-ps
- Note down the pid of the gallery app, then run the following command:
./run-gdb.sh attach <pid>
- Cause the crash.
- Run this command: