Skip to content

Instantly share code, notes, and snippets.

@c-goosen
Last active May 12, 2019 23:52
Show Gist options
  • Save c-goosen/cb79d260598809d3765df525bc888939 to your computer and use it in GitHub Desktop.
Save c-goosen/cb79d260598809d3765df525bc888939 to your computer and use it in GitHub Desktop.
Archiving Ionic 3 quickly with build and xcodebuild archive
# Script I use for quicker archiving of iOS builds.
# Might need to enter password for keychain based on your security preference
cd $(pwd)/platforms/ios
xcodebuild clean
cd ../../
ionic cordova build ios --release --production
# --prod should minify and compress html/css/js assets.
cd $(pwd)/platforms/ios
echo "\n"
echo "xcodebuild ios build"
echo "\n"
xcodebuild -workspace project.xcworkspace \
-scheme project \
-destination generic/platform=iOS build
echo "\n"
echo "xcodebuild ios archive"
echo "\n"
xcodebuild archive -project project.xcodeproj -scheme project \
-destination generic/platform=iOS -sdk iphoneos -verbose -configuration AppStoreDistribution \
-archivePath $(pwd)/build/project.xcarchive
echo "\n"
echo "xcodebuild ios archive ipa"
echo "\n"
xcodebuild -exportArchive -archivePath $(pwd)/build/project.xcarchive -exportOptionsPlist $(pwd)/ios-release-arch.xcarchive/Info.plist -exportPath $(pwd)/build
@hthetiot
Copy link


echo "\n"
echo "altool upload ipa"
echo "\n"

/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f "$(pwd)/build/project.ipa" -u $MY_ACCOUNT -p $MY_PASSWORD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment