Turn on the method of remote debugging of Chrome browser, supporting Windows, MacOS, and Linux

Here is how to enable remote debugging of Chrome browser on each operating system:

Windows operating system:

  1. Make sure you have Chrome installed and are in the latest version.
  2. Open a command prompt window (press Win + R, enter "cmd", and press Enter).
  3. C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
  4. In the Command Prompt window, enter the following command and press Enter:

    If your Chrome installation directory is different, please modify the command accordingly.

  5. The Chrome browser will start in debug mode and listen to port 9222 to accept remote debug connections.

  6. Or modify the shortcut directly:
  7. 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:

  1. Make sure you have Chrome installed and are in the latest version.
  2. Open the terminal application.
  3. /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
  4. 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:

  1. Make sure you have Chrome installed and are in the latest version.
  2. Open the terminal application.
  3. google-chrome --remote-debugging-port=9222
  4. Enter the following command in the terminal and press Enter:

    ifgoogle-chromeThe command cannot be found, please try usinggoogle-chrome-stableor other similar commands.

  5. 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.