From ed9c2c96ad7bf7df3463091193aa89c4009e11e6 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Wed, 7 Oct 2026 04:10:08 -0700 Subject: [PATCH] Accept --remote-debugging-port Summary: Launching the React Native DevTools shell with Electron's standard `--remote-debugging-port=` switch, for example to drive it from an end-to-end test over the Chrome DevTools Protocol, opens the port but then fails to open any window. Chromium consumes the switch at startup, but the shell's own launch-argument parsing is strict and rejects it as an unknown option, so the window for `--frontendUrl` is never created and the main process logs an unhandled rejection. Here, the launch-argument parser accepts `--remote-debugging-port` and ignores it. Chromium still acts on it, so the shell can be automated the same way as any Electron app, with no shell-specific environment variable or wrapper. Every other unknown option is still rejected. Changelog: [Internal] Differential Revision: D123603419 --- .../debugger-shell/src/electron/MainInstanceEntryPoint.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/debugger-shell/src/electron/MainInstanceEntryPoint.js b/packages/debugger-shell/src/electron/MainInstanceEntryPoint.js index f8c3b19aab01..1a74c800ef56 100644 --- a/packages/debugger-shell/src/electron/MainInstanceEntryPoint.js +++ b/packages/debugger-shell/src/electron/MainInstanceEntryPoint.js @@ -36,6 +36,11 @@ function handleLaunchArgs(argv: string[]) { windowKey: { type: 'string', }, + // Consumed by Chromium at startup (exposes the Chrome DevTools Protocol + // for automation); accepted here so that strict parsing doesn't reject it. + 'remote-debugging-port': { + type: 'string', + }, }, args: argv, });