Chrome Debug Launcher
Launch two independent Chrome instances: one normal, one with remote debugging on port 9222.
Steps
- 1. Kill all Chrome processes
- Launch normal Chrome (no extra args)
- Wait 2 seconds, then launch debug Chrome
Commands by Platform
Windows (PowerShell)
CODEBLOCK0
macOS (bash)
CODEBLOCK1
Result
- - Instance 1: Normal Chrome, default profile, regular use
- Instance 2: Debug Chrome, port 9222, isolated user data dir
- Connect via Selenium/Playwright: INLINECODE0
Chrome 调试启动器
启动两个独立的 Chrome 实例:一个普通实例,一个在端口 9222 上启用远程调试的实例。
步骤
- 1. 终止所有 Chrome 进程
- 启动普通 Chrome(无额外参数)
- 等待 2 秒,然后启动调试 Chrome
各平台命令
Windows(PowerShell)
powershell
步骤 1:终止 Chrome
taskkill /F /IM chrome.exe /T 2>$null
Start-Sleep -Seconds 2
步骤 2:普通 Chrome
Start-Process C:\Program Files\Google\Chrome\Application\chrome.exe
步骤 3:调试 Chrome(2 秒后)
Start-Sleep -Seconds 2
Start-Process C:\Program Files\Google\Chrome\Application\chrome.exe -ArgumentList --remote-debugging-port=9222, --user-data-dir=C:\selenum\ChromeProfile
macOS(bash)
bash
步骤 1:终止 Chrome
pkill -f Google Chrome 2>/dev/null; sleep 2
步骤 2:普通 Chrome
open -a Google Chrome
步骤 3:调试 Chrome(2 秒后)
sleep 2
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir=$HOME/selenium/ChromeProfile &
结果
- - 实例 1:普通 Chrome,默认配置文件,常规使用
- 实例 2:调试 Chrome,端口 9222,独立用户数据目录
- 通过 Selenium/Playwright 连接:http://localhost:9222