# \[UE 5.8.3\]\[Build\] macOS 27: every Mac game-target build fails at "Failed to finalize the .app with Xcode" because UBA starts xcodebuild with stdin closed

**URL:** <https://forums.unrealengine.com/t/ue-5-8-3-build-macos-27-every-mac-game-target-build-fails-at-failed-to-finalize-the-app-with-xcode-because-uba-starts-xcodebuild-with-stdin-closed/2840411>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine\
**Created:** [October 14, 2026, 5:12pm UTC](https://forums.unrealengine.com/t/ue-5-8-3-build-macos-27-every-mac-game-target-build-fails-at-failed-to-finalize-the-app-with-xcode-because-uba-starts-xcodebuild-with-stdin-closed/2840411 "2026-10-14T17:12:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dwight\_Everhart](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dwight\_Everhart](https://forums.unrealengine.com/u/Dwight_Everhart)\
**Post date:** [October 14, 2026, 5:12pm UTC](https://forums.unrealengine.com/t/ue-5-8-3-build-macos-27-every-mac-game-target-build-fails-at-failed-to-finalize-the-app-with-xcode-because-uba-starts-xcodebuild-with-stdin-closed/2840411/1 "2026-10-14T17:12:17Z")

</div>

### Summary

Since macOS 27, every UnrealBuildTool build of a Mac GAME target fails after all compile and link actions succeed:

```
ERROR: Failed to finalize the .app with Xcode. Check the log for more information
Result: Failed (OtherCompilationError) (exit code 6)

```

Editor targets are unaffected (they have no Xcode finalize step). BuildCookRun packaging and plugin host-project Game targets fail the same way. The console only says the scheme pre-action “Touch UBT generated tiles” failed, during ComputePackagePrebuildTargetDependencyGraph, with no reason. Xcode’s own .xcactivitylog (~/Library/Developer/Xcode/DerivedData/WORKSPACE-\*/Logs/Build/) has the real error:

```
Failed to launch task /bin/sh: The operation couldn't be completed. Bad file descriptor

```

Cause: inside a full build, the UBA local executor (the only local executor in 5.8; -NoUBA does not avoid it) starts the ApplePostBuildSync child so that the xcodebuild it launches (AppleToolChain.cs, FinalizeAppWithXcode, via Utils.RunLocalProcess, which redirects stdout/stderr but not stdin) execs with stdin (fd 0) CLOSED. lsof on the live xcodebuild shows fd 0 reused by a framework file dyld opened later. Under macOS 27, xcodebuild then cannot spawn the scheme’s shell-script pre-action.

Suggested fix: give xcodebuild a valid stdin. Verified workaround in FinalizeAppWithXcode: set StartInfo.RedirectStandardInput = true and call LocalProcess.StandardInput.Close() immediately after Start(), so stdin is valid and already at EOF (like \</dev/null). With that, the Game target, plugin host Game targets and BuildCookRun packaging all succeed. A more general fix may belong where UBA spawns non-detoured local processes, so children never inherit a closed fd 0.

### What Type of Bug are you experiencing?

Foundation (C++ Tools, Profiling, & Pipeline)

### Steps to Reproduce

1. On macOS 27 with Xcode 27, build any project’s Mac Game target with the installed UE 5.8.3, e.g. Engine/Build/BatchFiles/Mac/Build.sh PROJECT Mac Development PATH\_TO/PROJECT.uproject
2. All compile and link actions succeed; the ApplePostBuildSync action then fails at finalize (exit 6).
3. Isolated repro without UBT: copy the xcodebuild command UBT prints after “params:” (xcodebuild build -workspace … UE\_XCODE\_BUILD\_MODE=PostBuildSync) and run it from a shell with stdin closed (append 0\<&-): BUILD FAILED, exit 65, with the same “Bad file descriptor” in the .xcactivitylog. Run it with \</dev/null: BUILD SUCCEEDED.
4. Also: RunUBT.sh -Mode=ApplePostBuildSync -Input=…/PostBuildSync\_TARGET.json run on its own succeeds. It fails only when run as an action inside a full build.

### Expected Result

The Game target build finishes with Result: Succeeded and a finalized, signed .app, as it did on macOS 26 with the same Xcode 27 and UE 5.8.3.

### Observed Result

“ERROR: Failed to finalize the .app with Xcode”, Result: Failed (OtherCompilationError), exit 6, on every Game-target build and every packaging run. UBT’s retry pass (with the full environment shown) fails identically. Ruled out by bisection: the extra environment variables UBT sets (TMPDIR into the UBA session dir, DOTNET\_\*, UBA\_DETOURED, PATH), the working directory, piped stdout/stderr, and freshly written inputs. Xcode first-launch, licence and the Metal Toolchain are all in order.

Tested on UE 5.8.3 (launcher build), macOS 27.0.1, Xcode 27.0 (27A266a), Apple Silicon.

### Affects Versions

5.8

### Platform(s)

Mac

### Additional Notes

Side note, found while applying the workaround: rebuilding UnrealBuildTool from the installed engine’s source fails on Apple Silicon Macs without Rosetta, because EpicGames.Horde’s Grpc.Tools 2.59.0 resolves the macosx\_x64 protoc (“Bad CPU type in executable”).
