Firefox for Android: Remote Debugging is Here

Lucas blogged a while ago about some of the initial work on creating a remote debugging system for Firefox on Android. The desktop patches Lucas mentioned have landed, and remote debugging Firefox for Android is now possible.

Remote debugging requires using Desktop Firefox to connect to Mobile Firefox over USB using ADB. Remote debugging is supported in Firefox 15 and newer releases. Here’s a quick guide to getting started:

  1. USB Connection: Connect your Android device running Firefox to a host machine running desktop Firefox using USB. In a terminal, forward the TCP connection using: adb forward tcp:6000 tcp:6000
  2. Firefox Desktop: Use about:config to enable remote debugging. Set the “devtools.debugger.remote-enabled” pref to true. Restart. You should see a “Tools > Web Developer > Remote Debugger” menu.
  3. Firefox for Android: Use about:config to enable remote debugging. Set the “devtools.debugger.remote-enabled” pref to true. Restart.
  4. Firefox Desktop: Choose “Tools > Web Developer > Remote Debugger” and a Remote Connection dialog should open. If you changed none of the other remote debugger preferences, just use the defaults. Press OK.
  5. Firefox Desktop: You should see an empty debugging window appear.
  6. Firefox for Android: You should see a remote debugging connection prompt appear. Press OK to initialize the connection. You have 3 seconds, by default, to accept the connection. You can retry 3 times.
  7. Firefox Desktop: Once the connection is accepted, the empty debugging window will fill with scripts running in the Firefox for Android web page.

Thanks to Lucas, Panos Astithas and the rest of the DevTools team for making this happen. Happy Debugging!

7 Comments

  1. kats said,

    August 7, 2012 @ 9:59 am

    Is that FF15 in Desktop? Android? Both?

  2. Mark Finkle said,

    August 7, 2012 @ 12:33 pm

    @kats – Both Fx15 in Desktop and Android. I even tested it using Fx15 Desktop and Fx17 on Android, so mixing versions seems to work OK too.

  3. Anthony Ricaud said,

    August 7, 2012 @ 6:40 pm

    This is a really great start, awesome.

    Is there any bug opened to provide a friendlier user experience? (setting all this up with a few clicks)

  4. Mark Finkle said,

    August 7, 2012 @ 8:07 pm

    @Anthony – No bug I know about. Although, once the prefs are flipped, it get’s a lot easier. Also, there is a “Wifi Connection” as well, instead of using the ADB-over-USB method.

  5. Firefox for Android: Remote Debugging is Here – Mark Finkle's Weblog | tamal said,

    August 8, 2012 @ 5:46 pm

    […] Firefox for Android: Remote Debugging is Here – Mark Finkle's Weblog This entry was posted in Uncategorized and tagged archives, connection, desktop, explorer, […]

  6. Remote Debugging on Firefox for Android ✩ Mozilla Hacks – the Web developer blog said,

    August 9, 2012 @ 2:38 am

    […] Extra note: if you’re uncomfortable with the idea of having your Firefox listening for connections on the network, you can leave force-local set to true and follow Mark Finkle’s instructions for getting remote debugging running over USB. […]

  7. Remote Debugging on Firefox for Android « 13fqcs said,

    August 11, 2012 @ 5:28 am

    […] Extra note: if you’re uncomfortable with the idea of having your Firefox listening for connections on the network, you can leave force-local set to true and follow Mark Finkle’s instructions for getting remote debugging running over USB. […]

RSS feed for comments on this post