Here are quick instructions for getting the Firefox and Chrome web browsers running in a remotely debuggable state.
On the Mac all instructions assume you've opened a window in the Terminal application. On Windows all instructions assume you've opened the cmd application.
Here are the instructions for starting a new profile of Firefox on MacOS and Windows. Please file issues or make pull requests for any errors you encounter.
Required Flags
Running the Firefox profile you intended to debug navigate to about:config and use the search to find the following preferences. Double clicking the boolean preferences is the fastest way to toggle them. You must restart Firefox once you've made these changes.
devtools.debugger.remote-enabledtotruedevtools.chrome.enabledtotruedevtools.debugger.prompt-connectiontofalse
Already running Firefox? If you would like to make your current Firefox remotely debuggable; press
shift+F2and typelistenin the command bar. Make sure you have enabled the required preferences above.
On the Mac Firefox installs different application names for each release channel (release, beta, aurora, nightly) instead of overwriting the existing application.
Flags
These are the flags necessary to start the remote debug server and use an alternate profile.
- debug server
--start-debugger-server 6080 - separate profile
-P development(not required) - Note: if you are prompted with the profile manager you will need to create a profile named
development
$ /Applications/Firefox.app/Contents/MacOS/firefox-bin --start-debugger-server 6080 -P development
$ /Applications/FirefoxBeta.app/Contents/MacOS/firefox-bin --start-debugger-server 6080 -P development
$ /Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin --start-debugger-server 6080 -P development
$ /Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin --start-debugger-server 6080 -P development
Flags
- debug server
-start-debugger-server 6080 - separate profile
-P development
64 bit Windows
For users with a 64 bit machine Firefox may have installed in the: C:\Program Files (x86) folder.
$ "C:\Program Files\Mozilla Firefox\firefox.exe" -start-debugger-server 6080 -P development
$ "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -start-debugger-server 6080 -P development
Firefox for Android creates a Unix socket and listens there for debugger connections. To connect to it, use the adb tool's port forwarding feature:
adb forward tcp:6080 localfilesystem:/data/data/org.mozilla.fennec/firefox-debugger-socket
The exact path to the socket differs based on release channel. You can find the right value in Firefox on Android by loading about:config and checking the value of the preference devtools.debugger.unix-domain-socket.
Here are the instructions for starting a new temporary profile of Chrome on MacOS and Windows. Please file issues or make pull requests for any errors you encounter.
Flags
- debug server
--remote-debugging-port=9222 - ignore first run setup
--no-first-run - use temporary profile
--user-data-dir=/tmp/chrome-dev-profile
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --user-data-dir=/tmp/chrome-dev-profile
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --user-data-dir=/tmp/chrome-dev-profile
Flags
- debug server
--remote-debugging-port=9222 - ignore first run setup
--no-first-run - use temporary profile
--user-data-dir=%TEMP%\chrome-dev-profile
$ "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --no-first-run --user-data-dir=%TEMP%\chrome-dev-profile
$ "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --no-first-run --user-data-dir=%TEMP%\chrome-dev-profile