Part 2: TestFlight Easy Automation
By: Mike Chartier
Tags: iOS, Xcodebuild, Xcode, Automation

Part 2: TestFlight Easy Automation

In part 1 we showed how to distribute your app using default settings. In part 2 you will see how to customize the settings to suit your project.

There are many ways to customize your app distribution including signing, bitcode, app thinning, provisioning profiles, and more. Apple provides some basic documentation about these options here. Learning which setting(s) you want is beyond the scope of this article. But once you know which options you want it is simple to enter your choices into a custom export.plist file and start building. Here is an example plist file:



<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “

<plist version=”1.0">

<dict>

<key>method</key><string>app-store</string>

<key>teamID</key><string>YourTeamID</string>

<key>uploadBitcode</key><true/>

<key>compileBitcode</key><true/>

<key>uploadSymbols</key><true/>

<key>signingStyle</key><string>manual</string>

<key>signingCertificate</key><string>YourCertificate</string>

<key>provisioningProfiles</key>

<dict>

<key>com.client.appname</key>

<string>Client App Release</string>

<key>com.client.appname.watchkitapp</key>

<string>Client App WatchApp Release</string>

<key>com.client.appname.watchkitapp.watchkitextension</key>

<string>Client App WatchKitExtension Release</string>

<key>com.client.appname.RemoteNotificationServiceExtension</key>

<string>Client App PushExtension Release</string>

<key>com.client.appname.Stickers</key>

<string>Client App Stickers Release</string>

</dict>

</dict>

</plist> -//Apple//DTD PLIST 1.0//EN” “ http://www.apple.com/DTDs/PropertyList-1.0.dtd "> method app-store teamID YourTeamID uploadBitcode compileBitcode uploadSymbols signingStyle manual signingCertificate YourCertificate provisioningProfiles com.client.appname Client App Release com.client.appname.watchkitapp Client App WatchApp Release com.client.appname.watchkitapp.watchkitextension Client App WatchKitExtension Release com.client.appname.RemoteNotificationServiceExtension Client App PushExtension Release com.client.appname.Stickers Client App Stickers Release

Below is more information about each of the available options.

compileBitcode : Bool

For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES.

destination : String

Determines whether the app is exported locally or uploaded to Apple. Options are export or upload. The available options vary based on the selected distribution method. Defaults to export.

distributionBundleIdentifier : String

Reformat archive to focus on eligible target bundle identifier.

embedOnDemandResourcesAssetPacksInBundle : Bool

For non-App Store exports, if the app uses On Demand Resources and this is YES, asset packs are embedded in the app bundle so that the app can be tested without a server to host asset packs. Defaults to YES unless onDemandResourcesAssetPacksBaseURL is specified.

generateAppStoreInformation : Bool

For App Store exports, should Xcode generate App Store Information for uploading with iTMSTransporter? Defaults to NO.

iCloudContainerEnvironment : String

If the app is using CloudKit, this configures the “com.apple.developer.icloud-container-environment” entitlement. Available options vary depending on the type of provisioning profile used, but may include: Development and Production.

installerSigningCertificate : String

For manual signing only. Provide a certificate name, SHA-1 hash, or automatic selector to use for signing. Automatic selectors allow Xcode to pick the newest installed certificate of a particular type. The available automatic selectors are “Mac Installer Distribution” and “Developer ID Installer”. Defaults to an automatic certificate selector matching the current distribution method.

manifest : Dictionary

For non-App Store exports, users can download your app over the web by opening your distribution manifest file in a web browser. To generate a distribution manifest, the value of this key should be a dictionary with three sub-keys: appURL, displayImageURL, fullSizeImageURL. The additional sub-key assetPackManifestURL is required when using on-demand resources.

method : String

Describes how Xcode should export the archive. Available options: app-store, validation, ad-hoc, package, enterprise, development, developer-id, and mac-application. The list of options varies based on the type of archive. Defaults to development.

onDemandResourcesAssetPacksBaseURL : String

For non-App Store exports, if the app uses On Demand Resources and embedOnDemandResourcesAssetPacksInBundle isn’t YES, this should be a base URL specifying where asset packs are going to be hosted. This configures the app to download asset packs from the specified URL.

provisioningProfiles : Dictionary

For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.

signingCertificate : String

For manual signing only. Provide a certificate name, SHA-1 hash, or automatic selector to use for signing. Automatic selectors allow Xcode to pick the newest installed certificate of a particular type. The available automatic selectors are “Mac App Distribution”, “iOS Developer”, “iOS Distribution”, “Developer ID Application”, “Apple Distribution”, “Mac Developer”, and “Apple Development”. Defaults to an automatic certificate selector matching the current distribution method.

signingStyle : String

The signing style to use when re-signing the app for distribution. Options are manual or automatic. Apps that were automatically signed when archived can be signed manually or automatically during distribution, and default to automatic. Apps that were manually signed when archived must be manually signed during distribtion, so the value of signingStyle is ignored.

stripSwiftSymbols : Bool

Should symbols be stripped from Swift libraries in your IPA? Defaults to YES.

teamID : String

The Developer Portal team to use for this export. Defaults to the team used to build the archive.

thinning : String

For non-App Store exports, should Xcode thin the package for one or more device variants? Available options: <none> (Xcode produces a non-thinned universal app), <thin-for-all-variants> (Xcode produces a universal app and all available thinned variants), or a model identifier for a specific device (e.g. “iPhone7,1”). Defaults to <none>.

uploadBitcode : Bool

For App Store exports, should the package include bitcode? Defaults to YES.

uploadSymbols : Bool

For App Store exports, should the package include symbols? Defaults to YES.