Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save buagern/0a716e3b5285fb1c6f12ed3bb0210c56 to your computer and use it in GitHub Desktop.
Save buagern/0a716e3b5285fb1c6f12ed3bb0210c56 to your computer and use it in GitHub Desktop.

Revisions

  1. @piinecone piinecone created this gist Jul 2, 2014.
    28 changes: 28 additions & 0 deletions repack_ue4_ipas_for_dist.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/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"