Create a gist now

Instantly share code, notes, and snippets.

@lepinsk /archive.sh Secret
Last active Dec 15, 2015

manual archiving for the xcode build process
# casually breaking xcode's build process dot sh
# by julian lepinski; posted as part of http://lepinski.net/?p=159
# revised march 26, 2013
# reminder:
# this script operate by copying a template Info.plist (which I'm storing in $PROJECT_DIR) into your new .xcarchive bundles
# and then customizing it; you'll want to grab your own template file and modify the customization values below.
# disregard this message if you are me.
# archive name (as set in your scheme's archive settings):
SETENV ARCHIVE_FILE_NAME "Pano-App-Store"
# copy the template plist into the archive bundle
# (this presumes that the bundle is the most recent .xcarchive file below your Xcode/Archives folder)
cp "$PROJECT_DIR/Archive.Template.Info.plist" "$(find ~/Library/Developer/Xcode/Archives -name $ARCHIVE_FILE_NAME*.xcarchive | tail -1)/Info.plist"
# create a datetime variable in the format that plistbuddy expects because ugh
CREATION_DATE=`date +"%a %b %d %H:%M:%S %Z %Y"`
# insert the current date and time into our plist
/usr/libexec/PlistBuddy -c "Set :CreationDate $CREATION_DATE" "$(find ~/Library/Developer/Xcode/Archives -name $ARCHIVE_FILE_NAME*.xcarchive | tail -1)/Info.plist"
# set a build comment (this script comes from my appstore scheme, for example)
/usr/libexec/PlistBuddy -c "Set :Comment AppStore build" "$(find ~/Library/Developer/Xcode/Archives -name $ARCHIVE_FILE_NAME*.xcarchive | tail -1)/Info.plist"
# set our build name
/usr/libexec/PlistBuddy -c "Set :Name Pano AppStore build" "$(find ~/Library/Developer/Xcode/Archives -name $ARCHIVE_FILE_NAME*.xcarchive | tail -1)/Info.plist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment