Created
August 29, 2013 09:45
-
-
Save kukat/6376160 to your computer and use it in GitHub Desktop.
xcode command line build & archive .ipa
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
| # Clean & Build .app | |
| /usr/bin/xcodebuild -scheme PROJECT -workspace PROJECT.xcworkspace -configuration Release clean build CONFIGURATION_BUILD_DIR=${WORKSPACE}/build | |
| # Sign & Pack .ipa | |
| /usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/build/${APPLICATION_NAME}.app" -o "${WORKSPACE}/build/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
APPLICATION_NAME="Coffee Bean"
Clean & Build .app
/usr/bin/xcodebuild -scheme CBTL -workspace CBTL.xcworkspace -configuration Release clean build CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
Sign & Pack .ipa
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/build/${APPLICATION_NAME}.app" -o "${WORKSPACE}/build/${APPLICATION_NAME}.ipa" --sign "iPhone Distribution: The Coffee Bean & Tea Leaf (SINGAPORE) PTE LTD" --embed "${HOME}/Downloads/CBTL_ADHOC.mobileprovision"
APP_PATH="${WORKSPACE}/build/${APPLICATION_NAME}.app"
IPA_PATH="${WORKSPACE}/build/${APPLICATION_NAME}.ipa"
Get the version from the Info.plist file
VERSION=
defaults read "${APP_PATH}/Info" CFBundleShortVersionStringBUILD=
defaults read "${APP_PATH}/Info" CFBundleVersionBUNDLE_ID=
defaults read "${APP_PATH}/Info" CFBundleIdentifierBUNDLE_NAME_ESCAPED=
php -r "print rawurlencode('${APPLICATION_NAME}');"WEB_PATH=~/workspace/web
WWW_PATH=${WEB_PATH}/${BUNDLE_ID}/${BUILD_ID}
BUNDLE_VERSION="${VERSION} (Build ${BUILD})"
PLIST_URL="http://192.168.1.11/apps/${BUNDLE_ID}/${BUILD_ID}/manifest.plist"
IPA_URL="http://192.168.1.11/apps/${BUNDLE_ID}/${BUILD_ID}/${BUNDLE_NAME_ESCAPED}.ipa"
Move ipa to www folder
mkdir -p ${WWW_PATH}
cp ${IPA_PATH} ${WWW_PATH}
Create plist
cat ${WEB_PATH}/template.plist | sed -e "s/APP_NAME/${APPLICATION_NAME}/" -e "s/IPA_URL/${IPA_URL}/" -e "s/BUILD_ID/${BUILD_ID}/" -e "s/BUNDLE_ID/${BUNDLE_ID}/" -e "s/BUNDLE_VERSION/${BUNDLE_VERSION}/" > ${WWW_PATH}/manifest.plist
Create html
cat ${WEB_PATH}/template.html | sed -e "s/APP_NAME/${APPLICATION_NAME}/" -e "s/BUILD_ID/${BUILD_ID}/" -e "s/PLIST_URL/${PLIST_URL}/" -e "s/BUNDLE_VERSION/${BUNDLE_VERSION}/" > ${WWW_PATH}/index.html