Last active
February 21, 2019 08:34
-
-
Save SlaunchaMan/8797641 to your computer and use it in GitHub Desktop.
Enumerate all schemes in a project, archive them, and export as IPAs.
This file contains 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/bash | |
# Builds all targets and places IPAs in build/ | |
# Constants | |
SIGNING_IDENTITY="iPhone Distribution: Detroit Labs, LLC" | |
# Get a list of all schemes, then build each. | |
xcodebuild -project PROJECT.xcodeproj -list | \ | |
sed -n '/Schemes/,/^$/p' | \ | |
grep -v "Schemes:" | \ | |
while read scheme; do | |
echo "Building ${scheme}…" | |
build_dir="$(pwd)/build" | |
archivePath="${build_dir}/Archives/${scheme}.xcarchive" | |
exportPath="${build_dir}/${scheme}.ipa" | |
xcodebuild -project PROJECT.xcodeproj \ | |
-scheme "${scheme}" \ | |
-configuration Release \ | |
-sdk iphoneos \ | |
archive \ | |
-archivePath "${archivePath}" || exit $? | |
xcodebuild -exportArchive \ | |
-exportFormat IPA \ | |
-archivePath "${archivePath}" \ | |
-exportPath "${exportPath}" \ | |
-exportSigningIdentity "${SIGNING_IDENTITY}" || exit $? | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment