This section provides useful tips that can help with debugging on Firefox OS, whether you're doing so on emulator or on a real device, and whether or not you're doing out-of-process debugging.
You may also find this video helpful; it introduces the unit testing framework used for Firefox OS.
Restarting the b2g process
b2g (short for "Boot to Gecko") is the application that runs the Gecko user interface and handles launching Gaia applications; it's, in essence, the equivalent of a XULRunner application running on the phone atop the Android-based kernel. Sometimes you may want to restart it; this is a way to reset the application environment without rebooting the entire device. You can do this by entering the following on your terminal while your device is connected to your computer (or while running the debugger):
adb shell killall b2g
Forwarding ports to a local machine
Binaries for netcat and ssh are here:
host$ adb forward tcp:7979 tcp:6969
phone$ ./netcat -l -p 6969 < readback | ./netcat -l -p 5959 > readback
host$ ./netcat localhost 7979 < readback | ./netcat localhost 22 > readback
phone$ ./ssh localhost -p 5959 -L 9999:localhost:8000
This will forward port 9999 on the device to the host's port 8000