Remote Firefox Debugging on Android
Join the DZone community and get the full member experience.Join For Free
in the previous article i wrote about remote debugging web applications using chrome on android . if you don't want to use chrome or you want to test and debug your application on a different mobile browser you can also use firefox mobile to debug. the process is pretty much the same as for chrome.
- connect your mobile device with usb to your desktop computer
- setup your mobile firefox for remote debugging
- configure your desktop browser for remote debugging
- connect desktop browser to mobile browser and start debugging
to start debugging you have to connect your mobile device using usb to your desktop. once you've done this you can use the android 'adb' tool to setup a debug connection to your tablet or phone. if you need instructions on how to setup 'adb' see the previous article on chrome .
setup your mobile firefox for remote debugging
open your mobile firefox (make sure you've got the latest firefox mobile beta) and enter "about:config" in the url. this will open a screen where you can edit settings. in this screen set the "devtools.debugger.remote-enabled" to "true":
now restart firefox, and that's it for this part.
setup your desktop firefox for remote debugging
next we need to configure firefox on your desktop for remote debugging (i'm using a nightly build). once again go to the "about:config" url. this time set the "devtools.debugger.remote-enabled" property to true.
restart your browser and now you'll have a new entry in the "tools->web developer" menu called "remote debugger"
connect desktop browser to mobile browser and start debugging
now you're pretty much ready to start debugging. we mentioned at the start that we're going to use android's adb tool to set up the debug channel. to do this, run the following command:
firstname.lastname@example.org:~/dev/android-sdk-macosx/platform-tools$ ./adb forward tcp:6000 tcp:6000 * daemon not running. starting it now on port 5037 * * daemon started successfully * email@example.com:~/dev/android-sdk-macosx/platform-tools$
now point the browser on your mobile device to the page you want to debug and open your firefox on the desktop. on your desktop firefox select the "tools->web developer->remote debugger" option. just click enter on this popup:
when you do, you'll see another popup appear, but this time on your mobile device.
you've got a couple of seconds to click the ok button, and once you do, a remote debugging session will be created. from your desktop you can now set breakpoints, view scripts etc.
and that's it! very easy, and another great way to make debugging web/html applications on your mobile device easier. in the next couple of days, i'll also show how you can do this with opera.
Published at DZone with permission of Jos Dirksen, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.