Environment
System:
OS: macOS 26.3
CPU: (14) arm64 Apple M4 Pro
Memory: 237.67 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.19.5
path: /Users/rckm/.nvm/versions/node/v20.19.5/bin/node
npm:
version: 10.8.2
path: /Users/rckm/.nvm/versions/node/v20.19.5/bin/npm
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- iOS 26.2
- macOS 26.2
IDEs:
Xcode:
version: 26.2/17C52
path: /usr/bin/xcodebuild
Languages:
Ruby:
version: 3.4.5
path: /Users/rckm/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": 18.0.1
"@react-native-community/cli-platform-apple": 18.0.1
react: 19.0.0
react-native: 0.79.1
iOS:
hermesEnabled: true
newArchEnabled: true
Description
After updating to macOS 26.3 (Tahoe) with Xcode 26.2 (Build 17C52), react-native run-ios hangs indefinitely after the build succeeds. The xcodebuild process never exits, so the CLI never proceeds to install and launch the app on the simulator.
Building from Xcode IDE (Cmd+R) works fine.
Root Cause
In buildProject.js, the CLI listens for the close event on the spawned xcodebuild process:
buildProcess.on('close', code => { ... });
The close event requires both the process to exit and all stdio streams to close. On Xcode 26.2+, xcodebuild (or its child process SWBBuildService) keeps the pipes open after build completion, so the close event never fires.
Related Issues
Reproducible Demo
Steps to Reproduce
- Use macOS 26.3 + Xcode 26.2
- Run
npx react-native run-ios --verbose
- Build completes —
** BUILD SUCCEEDED ** appears in output
- CLI hangs indefinitely — never proceeds to app install/launch
- No compiler processes running (
ps aux | grep clang shows nothing)
xcodebuild process stays alive with SWBBuildService child that has no children of its own
Expected Behavior
After BUILD SUCCEEDED, the CLI should proceed to install and launch the app on the simulator.
Actual Behavior
The CLI hangs forever at BUILD SUCCEEDED. The xcodebuild process and its SWBBuildService child remain alive but idle.
Workaround
Patch @react-native-community/cli-platform-apple buildProject.js to detect BUILD SUCCEEDED in stdout and resolve immediately instead of waiting for the close event:
const buildProcess = _child_process().default.spawn('xcodebuild', xcodebuildArgs, getProcessOptions(args));
let buildOutput = '';
+ let buildResolved = false;
buildProcess.stdout.on('data', data => {
const stringData = data.toString();
buildOutput += stringData;
@@ -85,8 +86,22 @@
loader.start(`Building the app${'.'.repeat(buildOutput.length % 10)}`);
}
}
+ // Workaround: xcodebuild on Xcode 26.2+ may hang after build succeeds.
+ // Detect BUILD SUCCEEDED and resolve immediately instead of waiting for close.
+ if (!buildResolved && stringData.includes('BUILD SUCCEEDED')) {
+ buildResolved = true;
+ if (xcodebuildOutputFormatter) {
+ xcodebuildOutputFormatter.stdin.end();
+ } else {
+ loader.stop();
+ }
+ _cliTools().logger.success('Successfully built the app');
+ buildProcess.kill();
+ resolve(buildOutput);
+ }
});
buildProcess.on('close', code => {
+ if (buildResolved) return;
if (xcodebuildOutputFormatter) {
Apply via patch-package:
npx patch-package @react-native-community/cli-platform-apple
Environment
Description
After updating to macOS 26.3 (Tahoe) with Xcode 26.2 (Build 17C52),
react-native run-ioshangs indefinitely after the build succeeds. Thexcodebuildprocess never exits, so the CLI never proceeds to install and launch the app on the simulator.Building from Xcode IDE (Cmd+R) works fine.
Root Cause
In
buildProject.js, the CLI listens for thecloseevent on the spawnedxcodebuildprocess:The
closeevent requires both the process to exit and all stdio streams to close. On Xcode 26.2+,xcodebuild(or its child processSWBBuildService) keeps the pipes open after build completion, so thecloseevent never fires.Related Issues
macos-15-arm64andmacos-26-xlargeactions/runner-images#13264 — Xcode 26 xcodebuild hanging on CI runnersReproducible Demo
Steps to Reproduce
npx react-native run-ios --verbose** BUILD SUCCEEDED **appears in outputps aux | grep clangshows nothing)xcodebuildprocess stays alive withSWBBuildServicechild that has no children of its ownExpected Behavior
After
BUILD SUCCEEDED, the CLI should proceed to install and launch the app on the simulator.Actual Behavior
The CLI hangs forever at
BUILD SUCCEEDED. Thexcodebuildprocess and itsSWBBuildServicechild remain alive but idle.Workaround
Patch
@react-native-community/cli-platform-applebuildProject.jsto detectBUILD SUCCEEDEDin stdout and resolve immediately instead of waiting for thecloseevent:const buildProcess = _child_process().default.spawn('xcodebuild', xcodebuildArgs, getProcessOptions(args)); let buildOutput = ''; + let buildResolved = false; buildProcess.stdout.on('data', data => { const stringData = data.toString(); buildOutput += stringData; @@ -85,8 +86,22 @@ loader.start(`Building the app${'.'.repeat(buildOutput.length % 10)}`); } } + // Workaround: xcodebuild on Xcode 26.2+ may hang after build succeeds. + // Detect BUILD SUCCEEDED and resolve immediately instead of waiting for close. + if (!buildResolved && stringData.includes('BUILD SUCCEEDED')) { + buildResolved = true; + if (xcodebuildOutputFormatter) { + xcodebuildOutputFormatter.stdin.end(); + } else { + loader.stop(); + } + _cliTools().logger.success('Successfully built the app'); + buildProcess.kill(); + resolve(buildOutput); + } }); buildProcess.on('close', code => { + if (buildResolved) return; if (xcodebuildOutputFormatter) {Apply via
patch-package: