6 Pitfalls: My Automation Chrome Killed the Chrome in My Dock (bundle id split + ad-hoc re-signing)
Описание и применение
Автоматизация Playwright напрямую запускает Chrome, что приводит к конфликту с системным Chrome. Решение – создать отдельный экземпляр Chrome с другим bundle ID, пересобрать и подписать его, а также автоматически применять патчи к node_modules.
Задача
Playwright’s direct execution of Chrome interfered with the system’s Chrome, causing the Dock to think Chrome was running even when no GUI windows were open.
Результат
The Dock no longer reports Chrome as running when only automation scripts are active, and the automation Chrome remains functional without interfering with the user’s normal Chrome experience.
Рабочий процесс
- Copy /Applications/Google Chrome.app to a new location as Chrome Automation.app
- Change CFBundleIdentifier to com.google.ChromeAutomation in Info.plist
- Ad‑hoc re‑sign the bundle with codesign --deep
- Patch node_modules/playwright-core to point to the automation binary
- Set up a launchd agent to re‑apply the patch every 6 hours
Доказательства
Just rewriting CFBundleIdentifier to com.google.ChromeAutomation is enough for LaunchServices to register it as an app distinct from regular Chrome
Re‑signing the whole bundle ad‑hoc with --deep restores internal consistency
- Дата записи: 2026-09-14T19:15:59.261Z