
Here is how to enable remote debugging of Chrome browser on each operating system:
Windows operating system:
- Make sure you have Chrome installed and are in the latest version.
- Open a command prompt window (press Win + R, enter "cmd", and 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.
- The Chrome browser will start in debug mode and listen to port 9222 to accept remote debug connections.
- Or modify the shortcut directly:
- For a shortcut to Chrome browser, right-click "Properties", add --remote-debugging-port=9222 to the target column, and the port behind can be defined by yourself. After completion, start the browser.
macOS operating system:
- Make sure you have Chrome installed and are in the latest version.
- 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:
The Chrome browser will start in debug mode and listen to port 9222 to accept remote debug connections.
Linux operating system:
- Make sure you have Chrome installed and are in the latest version.
- Open the terminal application.
google-chrome --remote-debugging-port=9222
- Enter the following command in the terminal and press Enter:
if
google-chrome
The command cannot be found, please try usinggoogle-chrome-stable
or other similar commands. - The Chrome browser will start in debug mode and listen to port 9222 to accept remote debug connections.
Note: The above method will enable remote debugging when starting Chrome browser, but make sure your operating system and firewall configuration allows access to the specified debug port.