June 09, 2010

Script to make IPAs for ad-hoc distribution.

This script produces an IPA, then verifies to make sure the IPA is actually valid.
PRODUCT_NAME=""
IPA="${PRODUCT_NAME}.ipa"
APP="${PRODUCT_NAME}.app"

if [ -z "${PRODUCT_NAME}" ]; then
        echo "PRODUCT_NAME not set";
        exit 1;
fi

rm -rf ipa
mkdir -p ipa/Payload &&
cp -R build/Debug-iphoneos/${APP} ipa/Payload/ &&
pushd ipa &&
zip -q --symlinks -r ${IPA} Payload/ &&
mkdir test/ &&
cp ${IPA} test &&
cd test &&
unzip -q ${IPA} &&
cd Payload/ &&
codesign --verify --verbose ${APP} &&
popd
open ipa/
Designed to be ran from the command line, but it should be easily made into a build phase.

Cheers,
Steve