# UE 5.8.1 iOS Archive fails with "cp: \<App\>.app: Not a directory" during PhaseScriptExecution on Xcode 26.1.1 

**URL:** <https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine\
**Created:** [July 30, 2026, 2:36am UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359 "2026-07-30T02:36:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [July 30, 2026, 2:36am UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/1 "2026-07-30T02:36:51Z")

</div>

### Summary

After upgrading to Xcode 26.1.1, Unreal Engine 5.8.1 is unable to archive an iOS project.  
The project builds successfully, links successfully, and the application is staged correctly. The failure only occurs during the Xcode Archive phase in the generated “Copy Executable and Staged Data into .app” build script.  
The generated script attempts to copy staged files into:  
/ArchiveIntermediates//BuildProductsPath/IOS/-IOS-Shipping.app  
However, the destination is not treated as a directory and the script fails with:  
cp: -IOS-Shipping.app: Not a directory  
Command PhaseScriptExecution failed with a nonzero exit code  
As a result, Xcode fails to create the .xcarchive and Unreal reports:  
Unable to find a .xcarchive in Xcode’s Library  
This issue is reproducible after cleaning DerivedData, Intermediate, Binaries and Saved folders.  
The project packages correctly up to the staging step. The failure only occurs during the Archive step.

### What Type of Bug are you experiencing?

Platform Mobile

### Steps to Reproduce

1. Install Unreal Engine 5.8.1 (Launcher build).
2. Install Xcode 26.1.1.
3. Open any iOS project.
4. Package/Archive for iOS.
5. Wait until the Archive phase begins.
6. Observe that the “Copy Executable and Staged Data into .app” PhaseScriptExecution fails.

### Expected Result

The generated Xcode project should successfully create an .xcarchive and Unreal should continue packaging normally.

### Observed Result

Archive fails during PhaseScriptExecution with:  
cp: -IOS-Shipping.app: Not a directory  
No .xcarchive is generated.

### Affects Versions

5.8

### Platform(s)

iOS

---

<div class="post-metadata">

**Author:** ![Thoeme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thoeme](https://forums.unrealengine.com/u/Thoeme)\
**Post date:** [August 24, 2026, 1:45pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/2 "2026-08-24T13:45:39Z")

</div>

Hi there. I would like to +1 on this. Have you found a solution in the meantime?

---

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [August 25, 2026, 5:21pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/3 "2026-08-25T17:21:08Z")

</div>

No, but version 5.8.2 has been released. I checked the release notes and didn’t see anything indicating the issue had been fixed, but I’ll give it another try anyway.

---

<div class="post-metadata">

**Author:** ![lucky\_geo\_mango](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lucky_geo_mango/32/1211490_2.png) [@lucky\_geo\_mango](https://forums.unrealengine.com/u/lucky_geo_mango)\
**Post date:** [September 1, 2026, 3:39pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/4 "2026-09-01T15:39:19Z")

</div>

Any solution to this? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [September 19, 2026, 7:21pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/5 "2026-09-19T19:21:24Z")

</div>

No, I haven’t made any progress yet. How about you?

---

<div class="post-metadata">

**Author:** ![Thoeme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thoeme](https://forums.unrealengine.com/u/Thoeme)\
**Post date:** [September 24, 2026, 4:29pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/6 "2026-09-24T16:29:58Z")

</div>

Hi all. I was able to make some progress on this. By patching an engine file (XcodeProject.cs), then rebuilding the UnrealBuildTool I am now able to create a working .xcarchive via Xcode. But ONLY via Xcode. When I try to create one using the Package Project command from within the editor, then it always produces an old .xcarchive (the last successful one it can find).

So, although I can work with this and at least get my stuff out, it of course isn’t perfect. But someone in the Unreal Slackers Discord mentioned, that it has been working for them with source build versions of the engine.

If anyone is interested I can share more details on how to apply the patch, or you can use a source version of the engine, which should also work. The “fix” is quiet elaborate if one has no clue about the whole Unreal Engine build pipeline (as I myself do not).

Sadly even the 5.8.3 hotfix didn’t resolve this on my end.

Edit: After also rebuilding the AutomationTool it now works across all packaging variants. Package Project from within the editor, using the build command (with -archive) in Terminal and via Xcode - Product - Archive. I will follow up with a write up on how to apply the fix yourself tomorrow.

---

<div class="post-metadata">

**Author:** ![Thoeme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thoeme](https://forums.unrealengine.com/u/Thoeme)\
**Post date:** [September 25, 2026, 10:38am UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/7 "2026-09-25T10:38:34Z")

</div>

Hi all. So, here follows the quiet elaborate write up of what I had to do, to get this to work with an UE5.8 binary build of the engine. First and foremost **you should be familiar with Terminal** on Mac to get through this. I did this on my Mac, therefore the paths are Mac specific, but you should be able to apply this to CMD on Windows as well, at least for the patching part.

Then as a disclaimer: I was able to work around this issue by using Claude Code. So, decide for yourself if you want to trust this or not. I can only affirm you that it has worked for me.

Now let’s get going:

**Symptoms**

- Packaging for iOS produces a working `.app` that installs fine on-device via Xcode, but **never produces a valid, submittable** `.xcarchive`
- Enabling “Generate Xcode Archive” + “For Distribution” in Project Settings doesn’t help
- Manually forcing `-archive -distribution` via `RunUAT.sh BuildCookRun` fails with:

```plaintext
cp: .../BuildProductsPath/IOS/<YourApp>.app: Not a directoryCommand PhaseScriptExecution failed with a nonzero exit code
**ARCHIVE FAILED**

```

- If UAT still reports “success” afterward, check the resulting `.xcarchive` closely — UAT’s archive step silently falls back to copying an **old, stale archive** from `~/Library/Developer/Xcode/Archives/` when the real `xcodebuild archive` invocation fails, so it can look deceptively fine at a glance.
- This happens on Xcode 15+ (confirmed on 16.1 and 26.1), independent of engine hotfix version (reproduced on 5.8.2 and 5.8.3).

**Root cause**

During an Xcode **Archive** (“install”) build, Xcode redirects `CONFIGURATION_BUILD_DIR` through a **compatibility symlink** pointing to the real product location (`InstallationBuildProductsLocation`). This is normal Xcode behavior, not an engine bug by itself.

The bug is in the “Copy Executable and Staged Data into .app” script phase that **UnrealBuildTool** generates for iOS targets. One specific line:

```csharp
cp -r "${UPL_BUILD_DIR}" "${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}"

```

copies your plugins’ UPL build output (e.g. `GoogleService-Info.plist`) using `cp -r` against that symlinked destination. macOS’s `cp -R`/`-r` does not treat a symlink-to-directory as a valid “copy into” target the way a plain `cp` or `rsync` does, and fails with `Not a directory`. This never surfaces on a normal device Build (no symlink involved there), only on Archive — which is why it’s so easy to miss.

**Fixing XcodeProject.cs**

You need to adjust and add some lines of code to the XcodeProject.cs file, which can be found here:

File: `Engine/Source/Programs/UnrealBuildTool/ProjectFiles/Xcode/XcodeProject.cs`, method `ProcessScripts`.

1. **Insert a new line** right after **line 1556** (the rsync that copies the executable), inside the first CopyScript.AddRange block:

`"rsync -au \\\"${SRC_EXE}\\\" \\\"${DEST_EXE}\\\"",`  
Add: `"CONTENTS_DIR=$(cd -P \\\"${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}\\\" && pwd)",`

1. **Line 1638** (Program branch’s rm -rf) — interpolated string, change:

Replace: `$" rm -rf \\\"${{CONFIGURATION_BUILD_DIR}}/${{CONTENTS_FOLDER_PATH}}{SyncDestSubdir}\\\"",`  
With: `$" rm -rf \\\"${{CONTENTS_DIR}}{SyncDestSubdir}\\\"",`

1. **Line 1663** (the uecommandline.txt copy):

Replace: `" cp \\\"${STAGED_DIR}/uecommandline.txt\\\" \\\"${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}\\\"",`  
With: `" cp \\\"${STAGED_DIR}/uecommandline.txt\\\" \\\"${CONTENTS_DIR}\\\"",`

1. **Line 1667** — this is the actual bug, the cp -r for the UPL build output:

Replace: `"cp -r \\\"${UPL_BUILD_DIR}\\\" \\\"${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}\\\"",`  
With: `"cp -r \\\"${UPL_BUILD_DIR}\\\" \\\"${CONTENTS_DIR}\\\"",`

1. **Line 1677** (the cookeddata rsync) — interpolated string, change:  
Replace: `$"rsync -a --delete {ExcludeString} \\\"${{STAGED_DIR}}{SyncSourceSubdir}/\\\" \\\"${{CONFIGURATION_BUILD_DIR}}/${{CONTENTS_FOLDER_PATH}}{SyncDestSubdir}\\\"",`  
With: `$"rsync -a --delete {ExcludeString} \\\"${{STAGED_DIR}}{SyncSourceSubdir}/\\\" \\\"${{CONTENTS_DIR}}{SyncDestSubdir}\\\"",`

**Applying the fix**

1. Edit `XcodeProject.cs` as above.
2. Rebuild UnrealBuildTool itself — editing the .cs file alone does nothing until it’s recompiled. You can do this via this command in Terminal:

```bash
"<EngineDir>/Binaries/ThirdParty/DotNet/<version>/<platform>/dotnet" build \ "<EngineDir>/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj" -c Development

```

Then find where it actually built to (it does **not** land in `Engine/Binaries/DotNET/...` automatically):

```bash
find "<EngineDir>/Source/Programs/UnrealBuildTool" -name "UnrealBuildTool.dll"

```

and sync the real `bin/Development/<tfm>/` output folder into place:

```bash
rsync -a "<found bin folder>/" "<EngineDir>/Binaries/DotNET/UnrealBuildTool/"

```

Essentially we want to copy the newly built DLLs and other files for the UnrealBuildTool from `.../UE_5.8/Engine/Source/Programs/UnrealBuildTool/bin/Development/net10.0/...` to `.../UE_5.8/Engine/Binaries/DotNET/UnrealBuildTool/...`. And yes, make sure to override those. You can always use the verify option via the Launcher to revert those, or just copy the directory beforehand as backup.

1. **If you’re on a Launcher/binary-installed engine (not a source build), you must also rebuild `AutomationTool`** — this is the step that’s easy to miss and was quiet a doozy to find out. `AutomationTool` (which drives `RunUAT`/`BuildCookRun`’s `-archive` step, and is what the Editor’s “Package Project” button uses) ships precompiled and is **not** automatically rebuilt when you patch `UnrealBuildTool`. Source builds work “by default” simply because they recompile everything, including `AutomationTool`, during normal engine setup. Now, we want to actually rebuild AutomationTool the same way we did with UnrealBuild tool. Here are some Terminal commands to do it:

```bash
# 1. Find the path for the AutomationTool.csproj
find "<EngineDir>/Source/Programs/AutomationTool" -maxdepth 1 -name "*.csproj""<dotnet path>"

# 2. Rebuild the AutomationTool
build "<AutomationTool.csproj path>" -c Development

# 3. Get the path where the newly built AutomationTool DLL and files are
find "<EngineDir>/Source/Programs/AutomationTool" -name "AutomationTool.dll"

# 4. Copy them to the actual AutomationTool DLL path (binaries)
rsync -a "<found bin folder>/" "<EngineDir>/Binaries/DotNET/AutomationTool/"

```

So, again: You need to use the first two commands to actually build the AutomationTool. Step 3. & 4. are optional and you can just manually copy those files over if you prefer to do it manually.

These are the paths if you wish to do so: `.../UE_5.8/Engine/Source/Programs/AutomationTool/bin/Development/net10.0/...` to `.../UE_5.8/Engine/Binaries/DotNET/AutomationTool/...`

1. Delete any stale generated project files/caches so everything regenerates from the patched tools:

```bash
# 1. Delete ProjectFilesIOS located in your projects intermediate folder
rm -rf "<ProjectDir>/Intermediate/ProjectFiles" "<ProjectDir>/Intermediate/ProjectFilesIOS"

# 2. Delete derived data from your Macs developer folder
rm -rf ~/Library/Developer/Xcode/DerivedData/<YourProject>*

```

1. Try packaging again — via Terminal `RunUAT.sh BuildCookRun ... -distribution -archive`, or the Editor’s “Package Project”, or a manual Xcode Archive. All three now work identically.

**Make sure to verify**

- Check the resulting `.xcarchive`: `Products/Applications/<App>.app` should be several hundred MB (includes your actual cooked content), not just tens of MB (executable only).
- Run **Window → Organizer → (select archive) → Validate App** in Xcode — it should pass App Store submission checks.

And yes, that’s it. Quiet a process as promised, but the figuring it out part is what took a long time. But I hope, that this helps in preventing a severe headache for anyone else.

---

<div class="post-metadata">

**Author:** ![Thoeme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thoeme](https://forums.unrealengine.com/u/Thoeme)\
**Post date:** [September 28, 2026, 3:26pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/8 "2026-09-28T15:26:35Z")

</div>

Hi there. I’m not sure if you got notified, but maybe my response from above helps you.

---

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [September 29, 2026, 11:38am UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/9 "2026-09-29T11:38:54Z")

</div>

I just saw your message. Thank you for sharing your experience! I’ll follow what you wrote step by step and update you here with the result. Thanks again!

---

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [October 17, 2026, 1:13pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/10 "2026-10-17T13:13:42Z")

</div>

Thank you, the archiving issue has been resolved. I tested the game via TestFlight, but it crashed—though that is likely an issue on my end. I will reach out again once I am certain that everything is working perfectly. For now, however, the problem appears to be fixed. Thanks again!

---

<div class="post-metadata">

**Author:** ![gamedeuscorp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gamedeuscorp](https://forums.unrealengine.com/u/gamedeuscorp)\
**Post date:** [October 22, 2026, 2:57pm UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/11 "2026-10-22T14:57:35Z")

</div>

Its works. thanks again. @Thoeme  
One last question. The splash screen and startup video appear stretched. Do you have this issue too?

---

<div class="post-metadata">

**Author:** ![Thoeme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thoeme](https://forums.unrealengine.com/u/Thoeme)\
**Post date:** [October 29, 2026, 12:23am UTC](https://forums.unrealengine.com/t/ue-5-8-1-ios-archive-fails-with-cp-app-app-not-a-directory-during-phasescriptexecution-on-xcode-26-1-1/2739359/12 "2026-10-29T00:23:06Z")

</div>

Hm, actually I would not see this, as my solution is and was to create a custom splash screen by using UMG aka Widget Blueprints. I was fiddling with the built-in stuff or the “Custom Launchscreen Storyboard” in the past, but was never really happy with the results or the limited possibilities. Essentially I have a black screen image for the Launch Screen Image and then I will add my custom Widget. I know that isn’t perfect either, but I prefer this as I seem to have more control over how things look.
