com.apple.developer.associated-domains Not Correctly Written to IPA File During Unreal Engine 5.1/5.3.2 iOS Remote Packaging

While using Unreal Engine 5.1 (Windows platform) for iOS remote packaging, the com.apple.developer.associated-domains key is not correctly written to the final IPA file(ensuring the corresponding capabilities are enabled in the MobileProvision). Although the correct values are visible in the .entitlements file in the Intermediate/IOS directory, the value in the packaged IPA file appears as <string>*</string> instead of the expected list of domains.

Steps to Reproduce:

  1. In the Unreal Engine 5.1 project, make the following modifications:

    • Modify the IOSExports.cs file by adding the following code in the WriteEntitlements method:
      List<string> AssociatedDomains;
      
      if (PlatformGameConfig.GetArray("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "AssociatedDomains", out AssociatedDomains))
      {
          Text.AppendLine("\t<key>com.apple.developer.associated-domains</key>");
          Text.AppendLine("\t<array>");
      
          foreach (var Domain in AssociatedDomains)
          {
              if (string.IsNullOrEmpty(Domain))
              {
                  continue;
              }
              Console.WriteLine(string.Format("Write AssociatedDomains {0} entitlements", Domain));
              Text.AppendLine(string.Format("\t\t<string>applinks:{0}</string>", Domain));
          }
      
          Text.AppendLine("\t</array>");
      }
      
  2. Configure Associated Domains in the project settings, e.g., applinks:example.com.

  3. Use the Windows platform for iOS remote packaging.

  4. On the Mac, check the .entitlements file in the Intermediate/IOS directory to confirm that the com.apple.developer.associated-domains key is correctly written.

  5. Inspect the packaged IPA file and find that the value for com.apple.developer.associated-domains is <string>*</string> instead of the expected list of domains.

  6. Attempt to write other types of entitlements:

  • For example, com.apple.developer.kernel.increased-memory-limit, and confirm that these values are correctly written to the IPA file (ensuring the corresponding capabilities are enabled in the MobileProvision).
  1. Upgrade to Unreal Engine 5.3.2:
  • The issue persists even after upgrading.

I solved it.

  1. Create a file with name {Project}.entitlements, which is a xml and contains only com.apple.developer.associated-domains key-values in it. Note: not contains {Target} after {Project}.
<?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.developer.associated-domains</key>
	<array>
		<string>applinks:{example}.adj.st</string>
	</array>
</dict>
</plist>
  1. Add this file to Project/Build/IOS/ dir. then this file will be merged with mobile.provision file by iPhonePackager RepackageFromStage command during Package stage, and finally write into .app/{Project}{Target} unix exe file. (You can read iPhonePackager.sln Codesigning.cs to get more details )
  2. using command codesign -d --entitlements - {AbsolutePath}/Payload/{Project}{Target}.app to check unziped .ipa file whether it contains associated-domains or not on mac.