Last active
March 16, 2022 02:59
-
-
Save christianascone/8374ae81e493a8efac41b75dd42167c0 to your computer and use it in GitHub Desktop.
Archive a project with Cocoapods dependencies
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 | |
PROJECT_NAME="$(ls -d *.xcworkspace* | cut -d'.' -f1)" | |
# REF: https://bitbar.com/tipstricks-how-to-archive-and-export-ipa-from-script/ | |
# Clean project | |
echo "#### CLEAN ####" | |
xcodebuild clean -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" | |
# Archive | |
echo "#### ARCHIVE ####" | |
xcodebuild archive -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" -archivePath "${PROJECT_NAME}".xcarchive | |
# Export ipa | |
echo "#### EXPORT IPA ####" | |
xcodebuild -exportArchive -archivePath "${PROJECT_NAME}".xcarchive -exportPath "${PROJECT_NAME}" -exportOptionsPlist exportOptions.plist | |
# Clear | |
echo "#### CLEAR ARCHIVE ####" | |
rm -rf "${PROJECT_NAME}".xcarchive |
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 | |
# PRETTY VERSION | |
PROJECT_NAME="$(ls -d *.xcworkspace* | cut -d'.' -f1)" | |
# REF: https://bitbar.com/tipstricks-how-to-archive-and-export-ipa-from-script/ | |
# Clean project | |
echo "#### CLEAN ####" | |
xcodebuild clean -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" | xcpretty | |
# Archive | |
echo "#### ARCHIVE ####" | |
xcodebuild archive -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" -archivePath "${PROJECT_NAME}".xcarchive | xcpretty | |
# Export ipa | |
echo "#### EXPORT IPA ####" | |
xcodebuild -exportArchive -archivePath "${PROJECT_NAME}".xcarchive -exportPath "${PROJECT_NAME}" -exportOptionsPlist exportOptions.plist | |
# Clear | |
echo "#### CLEAR ARCHIVE ####" | |
rm -rf "${PROJECT_NAME}".xcarchive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment