DEV Community

Cover image for Automate distribution of Unreal Engine 5 to Apple TestFlight
Göran Syberg Falguera
Göran Syberg Falguera

Posted on

Automate distribution of Unreal Engine 5 to Apple TestFlight

To automate distributing a Unreal Engine 5.3.2 build to test flight, you can do the following. There may be other ways but this is the only way I got it working now.

  1. Build the xarchive with something like:
    RunUAT.command BuildCookRun -platform=IOS -project=ProjectName.uproject -clientConfiguration=Shipping -build -cook -stage -pak -package -distribution -archive

  2. At this point, you have a ProjectName.xcarchive archive. Now is your chance to go into the archive and poke the plist file with your custom versions etc. I did it with a script something like this. Call the script with: ./UpdateProjectVersion.command "0.0.1"

#!/bin/bash
if [ -z "$1" ]; then
    echo "Usage: $0 <version_number>"
    exit 1
fi

VERSION="$1"

pushd /ProjectName/Root/Folder

#Note, we assume we only have one xcarchive in this folder. Make sure to clean up
for file in *.xcarchive; do
    mv "$file" "ProjectName.xcarchive"
    break # Only rename the first one found
done

PLIST="ProjectName.xcarchive/Products/Applications/ProjectName.app/Info.plist"
if [ -f "$PLIST" ]; then
    # Using awk to insert lines after the first occurrence of <dict>
    awk -v ver="$VERSION" '/<dict>/{print;print "<key>CFBundleVersion</key>\n<string>"ver"</string>";next}1' "$PLIST" > temp.plist && mv temp.plist "$PLIST"
else
    echo "Info.plist not found."
    exit 1
fi

popd
Enter fullscreen mode Exit fullscreen mode
  1. Now you need to get a good ExportOptions.plist file. I suggest you make an ad-hoc distribution with xcode and grab the file that is output in the same directory as the ipa.

  2. Create an ipa.
    xcodebuild -exportArchive -archivePath ProjectName.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath .
    This will create the ipa in the current directory.

  3. Validate the ipa
    xcrun altool --validate-app -f ProjectName.ipa -t ios --apiKey APPSTORE_API_KEY_ID --apiIssuer APPSTORE_ISSUER_ID

  4. Upload the ipa
    xcrun altool --upload-app -f ProjectName.ipa -t ios --apiKey APPSTORE_API_KEY_ID --apiIssuer APPSTORE_ISSUER_ID

Note: Last two steps assume you have your app store key file in ~/.private_keys or one of the other valid search paths.

Top comments (2)

Collapse
 
ted_steen_c146c3659e8eb2c profile image
Ted Steen • Edited

Nice and succinct!

I am curious, how did you manage to pass APPSTORE_API_KEY_ID and APPSTORE_ISSUER_ID for signing to be used in your RunUAT.command BuildCookRun command?

EDIT: And provisioning profile!

Collapse
 
mghimirewhitehat profile image
mghimirewhitehat

Can you help me on how to publish game develop on Unreal to Mac App store?
I have uploaded my game through Transporter and asked my team members to test it using TestFlight app, we are getting issue libtbb.dylib code signature invalid in <7E55B893-41DB-34A5-B724-F7B147D73492>