Last active
June 9, 2016 01:24
-
-
Save mtsd/6b661167e4152bfa350f to your computer and use it in GitHub Desktop.
Xcode環境変数、xcodebuild
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
| # http://qiita.com/matsukaz/items/42d1372c9e4e31e611f5 | |
| # http://nanoka.wpcloud.net/?p=943 | |
| # http://hachinobu.hateblo.jp/entry/2014/02/19/140659 | |
| $ xcodebuild -showBuildSettings |
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
| #!/bin/sh | |
| #APP_NAME=$1 | |
| APP_NAME="MyApp" | |
| SCHEME_NAME="$APP_NAME" | |
| SCRIPT_PATH=`cd $(dirname $0) && pwd` | |
| OUTPUT_PATH=${SCRIPT_PATH}/build | |
| ARCHIVE_PATH=${OUTPUT_PATH}/${SCHEME_NAME}.xcarchive | |
| IPA_PATH=${OUTPUT_PATH} | |
| OPTIONS_PATH=${SCRIPT_PATH}/exportOptions | |
| if [ "$APP_NAME" = "" ]; then | |
| echo "set app name" | |
| exit 0 | |
| fi | |
| if [ -d $ARCHIVE_PATH ]; then | |
| echo "remove archive" | |
| rm -R $ARCHIVE_PATH | |
| fi | |
| if [ -e ${IPA_PATH}/${SCHEME_NAME}.ipa ]; then | |
| echo "remove ipa" | |
| rm ${IPA_PATH}/${SCHEME_NAME}.ipa | |
| fi | |
| xcodebuild clean -scheme ${SCHEME_NAME} | |
| xcodebuild archive -scheme ${SCHEME_NAME} -archivePath ${ARCHIVE_PATH} | |
| xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" \ | |
| -exportPath "${IPA_PATH}" \ | |
| -exportOptionsPlist "${OPTIONS_PATH}/adhoc.plist" |
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
| ## Archive & Export | |
| * clean | |
| ~~~ | |
| $ xcodebuild clean -scheme MyApp | |
| ~~~ | |
| * archive | |
| ~~~ | |
| $ xcodebuild archive -scheme MyApp -archivePath build/MyApp.xcarchive | |
| ~~~ | |
| * export | |
| ~~~ | |
| $ xcodebuild -exportArchive -archivePath build/MyApp.xcarchive -exportPath build/ -exportOptionsPlist exportOptions/adhoc.plist | |
| ~~~ | |
| * deprecated | |
| ~~~ | |
| $ xcodebuild -exportArchive -exportFormat ipa -archivePath build/MyApp.xcarchive -exportPath build/MyApp.ipa -exportOptionsPlist archive.plist -exportProvisioningProfile 'MyApp APNs distribution' | |
| ~~~ | |
| ## reference | |
| * [http://www.matrixprojects.net/p/xcodebuild-export-options-plist](http://www.matrixprojects.net/p/xcodebuild-export-options-plist) | |
| * [http://iti.hatenablog.jp/entry/2015/10/06/155004](http://iti.hatenablog.jp/entry/2015/10/06/155004) | |
| * [http://iridge.jp/blog/201502/5592/](http://iridge.jp/blog/201502/5592/) | |
| * [http://blog.ch3cooh.jp/entry/20150210/1423573065](http://blog.ch3cooh.jp/entry/20150210/1423573065) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment