I’m building a plugin for iOS that uses HealthKit, and I’ve set up an XML file to update the Info.plist automatically — this works perfectly.
However, I also need to include a .entitlements file to enable com.apple.developer.healthkit, and currently I have to manually assign it in Xcode every time the project is regenerated.
And while this seems to pass the entitlements during code signing, it doesn’t add them to the Xcode project’s “Code Signing Entitlements” field, so Xcode doesn’t recognize it until I manually reassign it. (I can see that the entitlements appear in the embedded provisioning profile in the .app package) This also causes the app when it is on an iOS device to return an error saying it is missing the com.apple.developer.healthkit entitlement.
Is there any Unreal-native way (from a plugin) to ensure .entitlements are fully integrated into the Xcode project automatically, similar to how Info.plist updates are handled? The Mac entitlements seem to work as when I open Xcode 2 entitlements are added by default. Looking at Unreal’s documentation it appears to be possible. UE Entitlements Docs
Ideally, I’d like the plugin to be drop-in and fully self-contained without needing extra manual steps in Xcode.
I have a question. I’m also in the process of packaging to iOS, and when I add entitements in Xcode, do I add them in (mac).xcworkspace? Or do you add them in (IOS).xcworkspace? I’d like to add entitements even though it’s manual. Can you tell me how to add them manually?
Currently, what I have done is that if I add Sign in with Apple as +Capability to Singing & Capabilities in (Mac).xcworkspace, an error occurred and it was not applied when I added Sign in with Apple to (IOS).xcworkspace.
And IOS packaging of the project path’s Config->DefaultEngine.unrealEngine in mac.
The Unreal Engine version is 5.3.2-Release, and I want to log in to Apple as Entitlements, but even if I add it in xcode, it does not add entitements to config->DefaultEngine.ini [/Script/IOSRuntimeSettings.IOSRuntimeSettings]
AdditionalEntitlements=../../Build/IOS/ProjectName.entitlements을 넣어주고
Project Path ->Build/IOS/ProjectName.entitements does not result in Sign in with Apple rights.
Since you said it can be done manually, may I know how you added it manually?
I would greatly appreciate your advice.
Here’s how I’ve been manually adding entitlements to my Unreal iOS project via Xcode:
Package the Project
First, I package the project for iOS in Unreal. Once the packaging completes, Unreal generates an Xcode project file (ProjectName.xcodeproj ) located in:
ProjectFolder/Intermediate/ProjectFilesIOS
Open in Xcode
Open the generated .xcodeproj file in Xcode. In the Project Navigator on the left, select the file with your project name (with the blue icon).
Add Capabilities
Navigate to the “Signing & Capabilities” tab. Click the “+ Capability” button to bring up the list of available entitlements. Select the ones you need (e.g., Push Notifications, Background Modes, etc.).
Running on Device
To run the project on a device, select the target iOS device in Xcode and press Command + R.
Archiving for Distribution
If you’re preparing an archive for distribution:
In Unreal, make sure “For Distribution” is enabled in the iOS packaging settings.
Also set the Build Configuration to “Shipping”.
Package the project again.
After that, open the updated .xcodeproj file and re-add the required entitlements (this step has to be repeated every time you package).
Then, from the Xcode menu, go to Product → Archive.
Distributing the Archive
Once the archive is generated, you can distribute it via TestFlight or App Store Connect.
I’ve successfully used this method for TestFlight distribution. I haven’t yet tried submitting to the App Store, but since the TestFlight build includes the required entitlements and permissions (Info.plist is correctly set up), I expect it should work.
This manual process works, but it’s tedious to repeat each time. That’s why I’m looking at ways to automate the inclusion of entitlements directly from Unreal, to streamline testing and deployment.
Thanks for the suggestion! I’m already adding Additional Plist Data via an XML file, so that part is covered. What I’m trying to figure out is how to properly add the HealthKit entitlement for iOS.