UE5.3 Modernized Xcode MacOS Distribution Sandbox Error

Archiving my MacOS Project in Xcode and upload it to AppStoreConnect results in a Sandbox error:

App sandbox not enabled. The following executables must include the “com.apple.security.app-sandbox” entitlement with a Boolean value of true in the entitlements property list:

Screenshot of Error:

In the Package Review I can see that the correct sandbox entitlement is set to true.
Screenshot of Package Review:

Although not all sub executables have that entitlement. I marked with a red arrow the ones that not have the entitlement.
Screenshot of Package Review:

How can I add the entitlement to those Executables?
Enable Sandbox is set to true.

Thank you for your help. I have already spent days on that problem.

Have there been any developments on this issue? I am running into the same problem.

No I still have the same issue.
IOS works fine meanwhile in UE5.3 with some additional installations from GitHub. MacOS doesn’t work due to that sandbox error.

Have you been able to find a solution? We are also running into that problem now.

Okay, I found a way to fix it. Be prepared for some annoying stuff…
For me it only complained about the EpicWebHelper. (I am running UE 5.3.2)

You have to add the Entitlement to the EpicWebHelper. To do this, you have to codesign the EpicWebHelper.app provided in the engine before you package the game.

I wrote a sh script to do this:

WebHelper="/PathToEngine/Engine/Binaries/Mac/EpicWebHelper.app"

Certificate="Developer ID Application: Your Certificate Name (*********)"
entitlement="Path/To/Entitlements/File/Sandbox.entitlements"

#printf "\n------ Codesign WebHelper ------\n"
codesign --force --deep -s "$Certificate" --options=runtime --timestamp --entitlements $entitlement -v $WebHelper"/Contents/MacOS/EpicWebHelper"
codesign --force --deep -s "$Certificate" --options=runtime --timestamp --entitlements $entitlement -v $WebHelper

Then you have to have create the Sandbox.entitlements file that is used in the script:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
</dict>
</plist>

Finally execute the sh script.

Please note:
Your entitlements file may have to include other entitlements as well.
Also I am not to sure if everything is needed for the codesign commands and if the parameters are appropriate… but it worked.

3 Likes

Hi, @B_REX
I am developing on Unreal 5.2. My game run successfully in Mac and I am successfully able to distribute externally in Mac however while uploading the game to the Mac App store, the com.apple.security.app-sandbox needs to set to true in entitlements.
If i do this then the game doesn’t run and quits unexpectedly.
And my prime suspect is EpicWebHelper because prior to this the game was running fine.
After using EpicWebHelper plugin and with com.apple.security.app-sandbox set to true, it is not running.
Can you let me know, what are the things that you had done to run the game successfully?