How to Remotely Debug Firefox for Android Over USB
This article provides a step-by-step guide on how to connect the
desktop version of the Firefox Web Browser to Firefox for Android using
a USB cable for remote debugging. It covers enabling the necessary
developer settings on your Android device, configuring the mobile
browser, and using the desktop Firefox about:debugging
interface to inspect and troubleshoot live mobile web pages directly
from your computer.
Step 1: Enable USB Debugging on Your Android Device
Before Firefox can communicate with your phone, you must enable Android's built-in developer settings.
- Open the Settings app on your Android device.
- Scroll down and tap About phone (or About device).
- Locate the Build number and tap it seven times in rapid succession until a message appears stating, "You are now a developer!"
- Go back to the main Settings menu and go to System > Developer options (the exact path may vary slightly by device manufacturer).
- Scroll down and toggle on USB debugging.
- Confirm the prompt that appears on your screen.
Step 2: Enable Remote Debugging in Firefox for Android
Next, you need to tell the mobile Firefox browser to allow incoming debugging connections.
- Open the Firefox app on your Android device.
- Tap the three-dot menu icon (either in the top-right or bottom-right corner, depending on your setup) and select Settings.
- Scroll down to the Advanced section.
- Toggle the switch for Remote debugging via USB to the ON position.
Step 3: Connect Your Device to the Computer
- Connect your Android device to your desktop or laptop using a data-capable USB cable.
- Unlock your phone screen.
- A prompt asking to "Allow USB debugging?" should appear on your phone, displaying your computer's RSA key fingerprint. Check the box for Always allow from this computer and tap Allow (or OK).
Step 4: Connect and Debug via Desktop Firefox
You do not need to install the Android SDK on your computer anymore; desktop Firefox handles the connection automatically.
- Open the Firefox browser on your desktop computer.
- Type
about:debugginginto the address bar and press Enter. - In the left-hand sidebar, click on Setup.
- Ensure that USB enabled is active. If it says "USB disabled", click the Enable USB Devices button. Firefox will automatically download the required ADB extension in the background.
- Wait a few seconds for your Android device to appear in the left-hand sidebar under the Setup option.
- Click the Connect button next to your device's name. (Check your phone screen again, as you may be prompted one more time to allow the connection).
- Once connected, click on your device's name in the left-hand sidebar.
You will now see a list of all tabs currently open in your Firefox for Android browser. Click the Inspect button next to any tab to open the familiar Firefox Developer Tools on your desktop, allowing you to inspect elements, view the console, and debug the mobile webpage in real time.