Changing Provisioning Profiles for iOS Distribution

Hi,

I’ve been writing a few iOS games with unreal and haven’t had any trouble testing them on devices. However I would not like to distribute the app to someone else via ADHOC. I have the profile downloaded but I can’t seem to sign the game with it. The .ipa file that is created is still signed with the developer profile.

Could someone tell me how I can get unreal to use the new profile?

After removing all signing certificates on my machine except the one I need I can no longer package the project. I now receive this error in the console when packaging.

MainFrameActions: Packaging (iOS): env: Code Sign error: No matching codesigning identity found: No codesigning identities (i.e. certificate and private key pairs) matching ???iPhone Developer??? were found.

So if its looking for developer profiles, how can I tell it to search for distribution profiles?

I was never able to get Unreal to actually sign the .ipa with the correct profile. So what I did was unpack the creating .ipa, add the correct provisioning profile to the package, resign it with the correct profile and repackage it. Works fine as a work around.

I ran into this same issue attempting to distribute a build with testflight (http://testflightapp.com). Here’s a gist of a shell script I put together for unpacking, resigning, and rebuilding with a single command:

Unpack, resign, and repack IPA's generated with Unreal Engine 4 · GitHub

Put that script somewhere in your $PATH (eg, ~/bin), name it something like distbuild, make it executable (chmod +x distbuild), edit the file and configure the paths, then run it with the name of your game:

distbuild MySweetGame

For the curious, here are the detailed steps for unpacking the .ipa, inserting the distribution profile, and then repacking the app:

  1. Create an ad hoc distribution provisioning profile in the Apple developer portal

  2. Ensure the provisioning profile is valid (open it in the XCode organizer to check). Generate a new certificate and regenerate a provisioning profile if it isn’t.

  3. In UE4, launch the game to your device or build an .ipa to create ~/path/yourgame/Binaries/IOS/yourgame.ipa

  4. cd ~/path/yourgame/Binaries/IOS and you should see your .ipa file

  5. Unpack your .ipa: unzip yourgame.ipa. This will create a Payload/ dir

  6. cp Payload/UE4Game.app/CustomResourceRules.plist Payload/UE4Game/ResourceRules.plist because the xcrun command expects a ResourceRules.plist file

  7. Run the following command from ~/path/yourgame/Binaries/IOS and remember to supply absolute paths for the -o and --embed options:

    xcrun -sdk iphoneos PackageApplication -v "Payload/UE4Game.app" -o "/Users/me/where/i/put/builds/yourgame_dist.ipa" --sign "iPhone Distribution: Your Name (etc)" --embed "/Users/me/where/i/keep/my_distrubition_profile.mobileprovision"

This will create a yourgame_dist.ipa which you can distribute to other devices.

Test flight has the ability to change the provisioning profile of an ipa you have uploaded. So as long as you can actually get it on test flight you can replace the provisioning profile afterwards.

Im struggling with this, im trying to make a distribution (on app store) ipa, but when i try to send the file I get the error, however I did the distribution provisioning profile and place it on the ios folder, Unreal built it with “For Distribution” checked successfully

I can confirm this doesn’t work any longer. Not even the links in these pages work any more unfortunately.