Created
September 17, 2011 16:42
-
-
Save brototyp/1224112 to your computer and use it in GitHub Desktop.
Automatic Distribution of AdHocs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SIGNING_IDENTITY="iPhone Distribution: <Your Name>" | |
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/<filename>.mobileprovision" | |
LOG="$SRCROOT/buildlog.txt" | |
SCP_USER="user" | |
SCP_HOST="example.de" | |
SCP_PATH="/var/www/adhocs/" | |
DATE=$( /bin/date +"%Y-%m-%d" ) | |
ARCHIVE=$( /bin/ls -t "${HOME}/Library/Developer/Xcode/Archives/${DATE}" | /usr/bin/grep xcarchive | /usr/bin/sed -n 1p ) | |
APP="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/Products/Applications/${PRODUCT_NAME}.app" | |
/usr/bin/open -a /Applications/Utilities/Console.app $LOG | |
echo "Creating .ipa for ${PRODUCT_NAME}... " >> $LOG | |
/usr/bin/perl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication -v "${APP}" -o "/tmp/${PRODUCT_NAME}.ipa" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}" | |
echo "done." >> $LOG | |
echo "Uploading to Server... " >> $LOG | |
scp "/tmp/${PRODUCT_NAME}.ipa" ${SCP_USER}@${SCP_HOST}:"${SCP_PATH}" >> $LOG | |
echo "Adjusting rights on Server... " >> $LOG | |
ssh ${SCP_USER}@${SCP_HOST} "chmod 755 \"${SCP_PATH}${PRODUCT_NAME}.ipa\"" >> $LOG | |
echo "done." >> $LOG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment