Firefox Android 68 access error console log through ADB in Firefox Desktop 68 using WebIDE

How to debug or access console log on Firefox Android 68 using Firefox Desktop 68.

Firefox Android 68 is the last version before Mozilla made a lot of adventurous changes. Therefore it is beneficial to stay at this version when writing this.

But debugging on this (and probably also more recent versions) Android version of Firefox is very complicated.

One could imagine you just go to a menu on Firefox Android and select Show console to display the error console in Firefox for Android. No. To access the console to debug Javascript errors you will have to do an extreme amount of unnecessary things, like connecting USB cables, installing drivers, unwanted and outdated software.

These instructions are made by trial and error.

You will need access to:

- The android device with Firefox Android 68 installed
- An OS in a virtual machine like VirtualBox or a computer with an OS that can run Firefox 72 and that can access the device through an USB connection.
- Firefox Desktop 68 download.
- Android Studio which provides ADB SDK.
- ADB drivers for the device, filling the ADB Interface driver request in the computer device manager

Prepare the OS to run Firefox Desktop 68, install it in a virtualbox and boot or boot the computer.

Search online for <your device name adb drivers>. Download and install the ADB drivers from a reliable source. Without them you will get an unknown ADB Interface in the Device manager even if you install ADB SDK mentioned below.

Download and install the Android Studio which contains the ADB SDK from https://developer.android.com/studio#downloads, beware this download is about 900 MB and swells to some gigabytes when installed. You may circumvent this by only downloading ADB SDK.

Open C:\Windows\System32\drivers\etc\hosts in Notepad, add these lines to block the aggressive Firefox updater:

127.0.0.1  www.mozilla.org
127.0.0.1  download.cdn.mozilla.net
127.0.0.1  aus5.mozilla.org
127.0.0.1  download.mozilla.org

Notice, if you skip this then Firefox Desktop will update to version 72, where WebIDE is messed with and deprecated. On Firefox Desktop 81 and onward is is it replaced with Remote debugging, which is NOT compatible with Firefox Android 68, it warns and writes an error message about missing target. This is the reason this note uses Firefox Desktop 68, to match Firefox Android 68.

Download and start the installation of Firefox Desktop 68, a download for Windows 7 is located here: https://www.filepuma.com/download/mozilla_firefox_64bit_68.0-22803/.

During the installation uncheck the maintenance service. When installed start it and go to hamburger menu in the top right, Options, search for update. Select Check for updates but let me choose to install them although it ignores it anyway, this is the reason for the lines in the hosts file. Notice that it says that Firefox is up to date on version 68 even though it is an outdated version because it cannot access the download domains.

On the Android device open the system settings by going to Apps, find the Settings cog icon. Scroll down to System, go to About the phone/tablet/etc, scroll down to Version and tap fast several times, a message about gaining developer access will be shown if you are not considered to be a developer already.

On the Android device open Firefox 68, click the dots in the top right, go to Settings, Advanced, scroll down to Developer tools, enable Remote debugging through USB.

Connect the USB cable to the Android device and to the computer.

If using a VirtualBox as the virtual machine to run the computer, remember to click the USB filters in the bottom right and select the Android device there to connect them two.

Answer to charge the device if asked for what to do with the connection.

You should also get a question if USB debugging should be enabled. Check the box to remember the computer connection and click OK to activate USB debugging.

Ensure Firefox Android 68 is open.

On the computer click the hamburger menu again, go to Web developer, WebIDE.

In the top right under USB devices should the Android device be listed. Click it.

On the Android device in Firefox 68 answer the Incoming connection question with Allow to allow the connection.

In the WebIDE to the left you should find the current active tabs in Firefox Android 68.

On the Android device open a page to debug in Firefox 68. Then in WebIDE click the tab to open the console.

References:
https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE_clone

This is a personal note. Last updated: 2020-10-05 19:53:52.



GitHub

My

GitLab

My

LinkedIn

My

Klebe.se

Don't forget to pay my friend a visit too. Joakim