Skip to content

Instantly share code, notes, and snippets.

@joemccann
Created March 16, 2026 21:42
Show Gist options
  • Select an option

  • Save joemccann/e903f814997d4f56c63142ed86a2143a to your computer and use it in GitHub Desktop.

Select an option

Save joemccann/e903f814997d4f56c63142ed86a2143a to your computer and use it in GitHub Desktop.

Guide: Create a "Chrome Debug" App for macOS

This guide provides a one-click solution to create a custom version of Chrome that bypasses the "Allow remote debugging?" prompt. This is ideal for developers using Chrome DevTools Protocol (CDP), Puppeteer, or Selenium on newer macOS versions like Tahoe.


Step 1: The One-Line Terminal Command

Copy and paste the entire block below into your Terminal and hit Enter.

cat << 'EOF' > ~/Desktop/create_chrome_debug.sh
#!/bin/bash
APP_PATH="/Applications/Chrome Debug.app"
mkdir -p "$APP_PATH/Contents/MacOS"
mkdir -p "$APP_PATH/Contents/Resources"

# Create the launch script
cat << 'INNER_EOF' > "$APP_PATH/Contents/MacOS/core_script"
#!/bin/bash
# Launch Chrome with the required flags for CDP
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir="$HOME/Documents/ChromeDebugProfile" &
INNER_EOF
chmod +x "$APP_PATH/Contents/MacOS/core_script"

# Create the app metadata
cat << 'INNER_EOF' > "$APP_PATH/Contents/Info.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com">
<plist version="1.0">
<dict>
    <key>CFBundleExecutable</key>
    <string>core_script</string>
    <key>CFBundleIconFile</key>
    <string>appIcon</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleName</key>
    <string>Chrome Debug</string>
</dict>
</plist>
INNER_EOF

# Copy the official Chrome icon if it exists
if [ -f "/Applications/Google Chrome.app/Contents/Resources/appIcon.icns" ]; then
    cp "/Applications/Google Chrome.app/Contents/Resources/appIcon.icns" "$APP_PATH/Contents/Resources/appIcon.icns"
fi

echo "✅ Success! 'Chrome Debug.app' is now in your Applications folder."
EOF
bash ~/Desktop/create_chrome_debug.sh && rm ~/Desktop/create_chrome_debug.sh

Step 2: How to Use It

  1. Locate the App: Open your Applications folder and find Chrome Debug.
  2. Add to Dock: Drag the icon to your Dock for quick access.
  3. The "Clean Start" Rule: To ensure the debugging flags are active, completely Quit any running instances of Google Chrome before clicking the Chrome Debug icon. If a "normal" version is already running, the flags will be ignored.

Step 3: Verify the Debugger is Listening

Once the app is running, use these methods to confirm the prompt has been bypassed and the port is open:

Method A: The Browser Check

Open any browser and go to:

http://localhost:9222/json/version
  • Success: You will see a JSON block with version details.
  • Failure: "Site can't be reached" (Chrome was already open in standard mode).

Method B: The Terminal Check

Run this command to see if port 9222 is active:

lsof -i :9222
  • Success: You will see Google Ch or core_scri listed as LISTEN.

Method C: The Inspect UI

Type this into your Chrome address bar:

chrome://inspect/#devices
  • Ensure "Discover network targets" is checked. You should see your open tabs listed under "Remote Target."

Why This Works

On macOS Tahoe, Chrome enforces stricter isolation for debugging. By using the --user-data-dir flag, we create a dedicated profile specifically for your debugging session. This tells Chrome the session is isolated from your primary data, which suppresses the manual security confirmation prompt.

Want to customize the port? Change 9222 in the script to any available port (e.g., 9333) to avoid conflicts with other development tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment