Last active
June 8, 2020 08:33
-
-
Save madhikarma/a744543ba8568271bad8f627df2b4cc7 to your computer and use it in GitHub Desktop.
xcodebuild script
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/sh | |
set -eo pipefail | |
IFS=$'\n\t' | |
# Constants | |
NOW=$(date +%s) | |
BUILD_FILE_NAME="MyApp-${NOW}" | |
SCHEME="MyApp" | |
WORKSPACE="MyApp" | |
PROJECT="MyApp" | |
CONFIGURATION="AdHoc" | |
PROFILE_NAME="MyApp AdHoc" | |
CODE_SIGN_IDENTITY_NAME="iPhone Distribution: company name here" | |
# Build (project) | |
xcodebuild -archivePath "${BUILD_FILE_NAME}.xcarchive" -project "${PROJECT}.xcodeproj" -scheme "${SCHEME}" -configuration "${CONFIGURATION}" archive clean | |
# Build (workspace) | |
#xcodebuild -archivePath "${BUILD_FILE_NAME}.xcarchive" -workspace "${WORKSPACE}.xcworkspace" -scheme "${SCHEME}" -configuration "${CONFIGURATION}" archive clean | |
# Export archive (code sign using export options plist to specify bitcode etc) | |
# Newer but not working in Xcode 8 if you use rvm to set non system Ruby (Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found.") | |
#xcodebuild -exportArchive -exportOptionsPlist "exportOptions-adhoc.plist" -archivePath "${BUILD_FILE_NAME}.xcarchive" -exportPath "${BUILD_FILE_NAME}.ipa" | |
# Export archive (code sign using profile and code sign identity) | |
# Legacy but still working (Warning: xcodebuild: WARNING: -exportArchive without -exportOptionsPlist is deprecated) | |
xcodebuild -exportArchive -archivePath "${BUILD_FILE_NAME}.xcarchive" -exportPath "${BUILD_FILE_NAME}.ipa" -exportFormat ipa -exportProvisioningProfile "${PROFILE_NAME}" CODE_SIGN_IDENTITY="${CODE_SIGN_IDENTITY_NAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment