
Here are the methods to enable remote debugging for Chrome browser on various operating systems:
Windows Operating System:
- Ensure that you have installed Chrome browser and it is up to date.
- Open a command prompt window (press Win + R, enter "cmd", and then press Enter).
C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
- In the Command Prompt window, enter the following command and press Enter:
If your Chrome installation directory is different, please modify the command accordingly.
- Chrome browser will start in debug mode and listen on port 9222 to accept remote debugging connections.
- Or directly modify the shortcut:
- Create a shortcut for the Chrome browser, right-click and select 'Properties', add --remote-debugging-port=9222 in the 'Target' field, you can define the port yourself, and then start the browser.
macOS Operating System:
- Ensure that you have installed Chrome browser and it is up to date.
- Open the Terminal application.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
- Enter the following command in the terminal and press Enter:
Chrome browser will start in debug mode and listen on port 9222 to accept remote debugging connections.
Linux Operating System:
- Ensure that you have installed Chrome browser and it is up to date.
- Open the Terminal application.
google-chrome --remote-debugging-port=9222
- Enter the following command in the terminal and press Enter:
If
google-chrome
Command not found, please try usinggoogle-chrome-stable
or a similar command. - Chrome browser will start in debug mode and listen on port 9222 to accept remote debugging connections.
Note: The above method enables remote debugging when starting Chrome browser, but please ensure that your operating system and firewall settings allow access to the specified debugging port.