Search code examples
androiddebuggingfirefoxadb

Firefox remote debug "unexpected error" on Windows 8


I need debug a web application in Firefox for "Android". I am trying to connect the device to desktop Firefox, but always got the error "unexpected error".

I have performed all steps of https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android

  1. I installed the Android SDK Tools and Platforms, and the device is correctly detected with the adb command.

  2. I enabled remote debugging on desktop Firefox and Firefox for Android

  3. I enabled remote USB debugging on the device.

  4. The device is connected to the original cable to my PC.

  5. I run the command adb forward tcp: 6000 tcp: 6000 on the command line without problems.

  6. Finally, the developer desktop Firefox menu, I choose the connect option. Page appears to connect to localhost: 6000, and clicking on the "connect" button, the error "unexpected error" appears.

Any ideas?


Solution

  • Found the solution!

    Instead of typing:

    adb forward tcp:6000 tcp:6000
    

    type in the following:

    adb forward tcp:6000 localfilesystem:/data/data/org.mozilla.firefox/firefox-debugger-socket
    

    The first command is for firefox 34, for latter versions, you need the second.

    Also, according to the docs:

    For Firefox for Android builds in other channels, the org.mozilla.firefox part should be changed to:

    • org.mozilla.firefox_beta for Beta
    • org.mozilla.fennec_aurora for Aurora
    • org.mozilla.fennec for Nightly