Summary
When an iOS binary is run on Apple Silicon Mac in “Mac (Designed for iPad)” compatibility mode, FIOSPlatformFile::ConvertToPlatformPath() and FIOSPlatformMisc::GamePersistentDownloadDir() resolve write paths to
NSDocumentDirectory and NSLibraryDirectory, which are read-only in this sandbox configuration. All file write attempts to those directories fail with EPERM (errno=1).
Steps to Reproduce
1. Build an iOS target (iphoneos SDK, arm64) for any Unreal project
2. Install and run it on an Apple Silicon Mac via iOS App Installer (the “Mac (Designed for iPad)” path)
3. Attempt any file write through UE’s IFileManager or FPlatformFileManager (e.g. config, save games, persistent download directory)
Expected Result
Write succeeds. On a physical iOS device, NSDocumentDirectory is writable.
Actual Result
Write fails with Operation not permitted (errno=1). Under Mac-iPad compatibility mode, macOS maps NSDocumentDirectory and NSLibraryDirectory to a read-only location inside the .app bundle container. Only
NSApplicationSupportDirectory is writable.
Root Cause
Two sites in the iOS platform layer are affected:
1. IOSPlatformFile.cpp — ConvertToPlatformPath(): The bForWrite branch unconditionally resolves to NSDocumentDirectory (public) or NSLibraryDirectory (private). On Mac-iPad, both are read-only. Additionally,
paths that callers have already resolved to an absolute container path (e.g. via NSSearchPathForDirectoriesInDomains) are re-processed and mangled by the ReplaceInline(“../”) strip logic.
2. IOSPlatformMisc.cpp — GamePersistentDownloadDir(): Returns a relative path (e.g. ../../../MyProject/PersistentDownloadDir) regardless of platform mode. Callers that use this path directly via POSIX mkdir
(bypassing IOSPlatformFile) attempt to create directories relative to the read-only .app bundle location.
Confirmed via runtime logging that all write attempts return errno=1 until redirected to
NSApplicationSupportDirectory.
Fix
Detect Mac-iPad mode via [[NSProcessInfo processInfo] isiOSAppOnMac] (available iOS 14+ / macOS 11+):
- In ConvertToPlatformPath(): (a) return already-absolute container paths unchanged, and (b) redirect write paths to NSApplicationSupportDirectory instead of NSDocumentDirectory/NSLibraryDirectory.
- In GamePersistentDownloadDir(): redirect the base path to NSApplicationSupportDirectory and return the resulting absolute path (not the relative path) so POSIX callers also write to the correct location.
Affected Versions
Verified on UE 5.x (tested against UE 5.7 / SDK iphoneos26.1). The issue is present in any UE version that supports iOS deployment without explicit Mac-iPad handling.
Platform
macOS 15.x (Sequoia), Apple Silicon (arm64), iOS app in “Mac (Designed for iPad)” mode
Workaround
None available without engine changes. The issue manifests as silent failure (EPERM) on any persistent storage write, breaking save games, config, download caches, and any plugin that uses FPlatformFileManager.
Attachments
Proposed fix (two files):
- Engine/Source/Runtime/Core/Private/IOS/IOSPlatformFile.cpp
- Engine/Source/Runtime/Core/Private/IOS/IOSPlatformMisc.cpp
[Attachment Removed]