archiveのときだけ実行したい
- aggregateをtargetに追加する。(Editor > Add Target)
- 追加したaggregateのBuild Phasesにrun scriptを追加する
- schemaを変更してarchive時だけ、targetを実行する
- もともと、crashlyitcsのrun scriptをarchiveのときだけ実行したかったので、上のようにaggregateを作成して実装したけど、ダメだった。。理由は、build settingを見てcrashlyitcsのrun scriptは実行されるから。
- buildsettingに関係なく実行するscriptで、archiveのときだけ実行したいならいいかもしれない
configurationがReleaseの時だけ実行したい
- これでも毎回buildすることはなくなる
releaseConfig="Release"
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then
echo "Running Crashlytics"
./Crashlytics.framework/run {your_api_key_here}
fi
参考
- http://stackoverflow.com/questions/5471396/running-script-only-for-an-archive-build-in-xcode-4
- http://stackoverflow.com/questions/6747499/when-and-how-to-use-aggregate-target-in-xcode-4
- http://support.crashlytics.com/knowledgebase/articles/118559-can-i-make-the-dsym-uploading-only-on-release-buil
- http://disanji.net/iOS_Doc/#documentation/DeveloperTools/Conceptual/XcodeBuildSystem/100-Targets/bs_targets.html