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
I installed the Android SDK Tools and Platforms, and the device is correctly detected with the adb command.
I enabled remote debugging on desktop Firefox and Firefox for Android
I enabled remote USB debugging on the device.
The device is connected to the original cable to my PC.
I run the command adb forward tcp: 6000 tcp: 6000 on the command line without problems.
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?
in the Firefox menu (or Tools menu if you display the menu bar or are on macOS), click Web Developer then Debugger. press Ctrl + Shift + i ( Command + Option + i on macOS) and click Debugger.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With