UE5.6 MacOS build IOS code sign fail System.IO.IOException: Permission denied

On macOS 14.7.2(Intel chip)

UE ver 5.6.1

While build iOS game in editor ,got following error

UATHelper: Packaging (IOS): System.UnauthorizedAccessException: Access to the path ‘/Users/a/Library/Developer/Xcode/UserData/Provisioning Profiles’ is denied.
UATHelper: Packaging (IOS): —> System.IO.IOException: Permission denied
UATHelper: Packaging (IOS): — End of inner exception stack trace —
UATHelper: Packaging (IOS): at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
UATHelper: Packaging (IOS): at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException) UATHelper: Packaging (IOS): at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
UATHelper: Packaging (IOS): at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
UATHelper: Packaging (IOS): at System.IO.File.ReadAllText(String path, Encoding encoding)
UATHelper: Packaging (IOS): at IOSPlatform.CodeSign(String BaseDirectory, String GameName, FileReference RawProjectPath, UnrealTargetConfiguration TargetConfig, String LocalRoot, String ProjectName, String ProjectDirectory, Boolean IsCode, Boolean Distribution, String Provision, String Certificate, String Team, Boolean bAutomaticSigning, String SchemeName, String SchemeConfiguration)
UATHelper: Packaging (IOS): at IOSPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)
UATHelper: Packaging (IOS): at AutomationScripts.Project.Package(ProjectParams Params, Int32 WorkingCL)
UATHelper: Packaging (IOS): at BuildCookRun.DoBuildCookRun(ProjectParams Params)
UATHelper: Packaging (IOS): at BuildCookRun.ExecuteBuild()
UATHelper: Packaging (IOS): at AutomationTool.BuildCommand.Execute()
UATHelper: Packaging (IOS): at AutomationTool.BuildCommand.ExecuteAsync()
UATHelper: Packaging (IOS): at AutomationTool.Automation.ExecuteAsync(List1 CommandsToExecute, Dictionary2 Commands)
UATHelper: Packaging (IOS): at AutomationTool.Automation.ExecuteAsync(List1 CommandsToExecute, Dictionary2 Commands)
UATHelper: Packaging (IOS): at AutomationTool.Automation.ProcessAsync(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies)
UATHelper: Packaging (IOS): (see /Users/a/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

Definitely this is a bug.

The UAT file /Engine/Source/Programs/AutomationTool/IOS/IOSPlatform.Automation.cs

line 1137 may be a mistake

The engine was downloaded from Epic and the code has been modified, but it doesn’t work. How can I continue.

Hi,
This does appear to be legitimate bug as pointed out by @akbot48. One alternative is to migrate the project to ‘Automatic Signing’ to avoid this path in Unreal AutomationTool. However, if manual code signing is necessary, you would need to patch $UE_ROOT/Engine/Source/Programs/AutomationTool/IOS/IOSPlatform.Automation.cs:

  1. string AllText = File.ReadAllText(MobileProvisionDir.FullName);

with

  1. string AllText = File.ReadAllText(MobileProvisionFile.FullName);

and rebuild UAT. If you are running on a Launcher build, you would need to drop the contents of the attached Zip into $UE_ROOT/Engine/Build/BatchFiles and run

  1. sh $UE_ROOT/Engine/Build/BatchFiles/BuildUAT.sh

    Best regards

BuildUAT.zip (4.2 KB)