Cleaning and compiling code for iPhone, on project MyProject for schema Qa:
xcrun xcodebuild clean \
-workspace "MyProject.xcworkspace" \
-scheme "YourScheme" \
-sdk iphoneos \
-configuration Debug \
archive \
-archivePath builds/MyProject.xcarchive
Configuration can be either Debug
or Release
.
Signing the previously compiled code:
xcrun xcodebuild -exportArchive \
-archivePath builds/MyProject-Qa.xcarchive \
-exportOptionsPlist config.plist \
-exportPath builds
config.plist
contains the information about how to package and sign the application, for development builds use:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>development</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
An App Store release plist should contain something like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>teamID</key>
<string>xxxxxxxxxxx</string>
<key>method</key>
<string>app-store</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
Where the Team ID can be obtained from your keychain.
All available parameters
compileBitcode
embedOnDemandResourcesAssetPacksInBundle
iCloudContainerEnvironment
manifest
method
onDemandResourcesAssetPacksBaseURL
teamID
thinning
uploadBitcode
uploadSymbols
To get a more information about each of the parameters run xcodebuild --help