From 6aa7e35ec35b1b08a5354a89a7e9cee2ee9b6ece Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 22 May 2026 08:24:13 -0700 Subject: [PATCH] Remove --version spawn from debugger shell preparation (#56706) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56706 Addresses an issue where on macOS, we briefly flashed the RNDT app icon in the Dock. (This has been raised to us recently by Expo.) **More info** The `unstable_prepareDebuggerShell` health check was spawning the Electron binary with `--version` after a successful `dotslash fetch`. Invoking the native binary causes the app icon flash. - I couldn't find an Electron-side way to eliminate this (e.g. headless). - DotSlash already performs mandatory verification of every fetched artifact. The additional `--version` spawn was therefore redundant/overkill. Changelog: [General][Fixed] - React Native DevTools will no longer briefly flash in the system dock/taskbar when starting Metro Reviewed By: cortinico Differential Revision: D104061238 fbshipit-source-id: 5baafbc9a452438bb6ddcfb584975cae12618e0c --- .../debugger-shell/src/node/index.flow.js | 19 +------------------ .../src/node/private/LaunchUtils.js | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/debugger-shell/src/node/index.flow.js b/packages/debugger-shell/src/node/index.flow.js index a3918962f91..1a8e4d2b2ae 100644 --- a/packages/debugger-shell/src/node/index.flow.js +++ b/packages/debugger-shell/src/node/index.flow.js @@ -8,10 +8,7 @@ * @format */ -import { - prepareDebuggerShellFromDotSlashFile, - spawnAndGetStderr, -} from './private/LaunchUtils'; +import {prepareDebuggerShellFromDotSlashFile} from './private/LaunchUtils'; const {spawn} = require('cross-spawn'); const debug = require('debug')('Metro:DebuggerShell'); @@ -174,20 +171,6 @@ async function unstable_prepareDebuggerShell({ throw new Error(`Unknown flavor: ${flavor}`); } - const [binaryPath, baseArgs] = getShellBinaryAndArgs( - flavor, - prebuiltBinaryPath, - ); - const {code, stderr} = await spawnAndGetStderr(binaryPath, [ - ...baseArgs, - '--version', - ]); - if (code !== 0) { - return { - code: 'unexpected_error', - verboseInfo: stderr, - }; - } return {code: 'success'}; } catch (e) { return { diff --git a/packages/debugger-shell/src/node/private/LaunchUtils.js b/packages/debugger-shell/src/node/private/LaunchUtils.js index 5972f2841b6..2f78239f231 100644 --- a/packages/debugger-shell/src/node/private/LaunchUtils.js +++ b/packages/debugger-shell/src/node/private/LaunchUtils.js @@ -95,4 +95,4 @@ async function prepareDebuggerShellFromDotSlashFile( }; } -export {spawnAndGetStderr, prepareDebuggerShellFromDotSlashFile}; +export {prepareDebuggerShellFromDotSlashFile};