Skip to content

Instantly share code, notes, and snippets.

@werelord
Forked from piinecone/repack_ue4_ipas_for_dist.sh
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save werelord/e06bb9f572b2cf0d725d to your computer and use it in GitHub Desktop.
Save werelord/e06bb9f572b2cf0d725d to your computer and use it in GitHub Desktop.
#!/bin/bash
# USAGE
# 1. name this file something like `distbuild`, make it executable (chmod +x), and put it in your PATH
# 2. run it and pass it the name of your project, eg `distbuild MySweetGame`
TIMESTAMP=$(date +"%m%d%y") # eg, 070214
CERT_NAME="iPhone Distribution: Your Certificate's Name (And Identifier)"
# where you want your builds to go
BUILD_PATH="/absolute/path/to/builds/$1/binaries/$1-$TIMESTAMP.ipa"
# where you keep your distribution .mobileprovision
PROFILE_PATH="/absolute/path/to/builds/$1/profiles/$1.mobileprovision"
# the unreal projects dir
UNREAL_PATH="/absolute/path/to/Documents/Unreal Projects"
IOS_BINARIES_PATH="$UNREAL_PATH/$1/Binaries/IOS"
IPA_PATH="$IOS_BINARIES_PATH/$1.ipa"
echo "Unpacking $IPA_PATH into $IOS_BINARIES_PATH"
unzip "$IPA_PATH" -d "$IOS_BINARIES_PATH" > /dev/null
echo "Creating temporary $IOS_BINARIES_PATH/ResourceRules.plist"
cp "$IOS_BINARIES_PATH/Payload/UE4Game.app/CustomResourceRules.plist" "$IOS_BINARIES_PATH/Payload/UE4Game.app/ResourceRules.plist" > /dev/null
echo "Resigning application"
xcrun -sdk iphoneos PackageApplication -v "$IOS_BINARIES_PATH/Payload/UE4Game.app" -o "$BUILD_PATH" --sign "$CERT_NAME" --embed "$PROFILE_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment