With the release of Xcode 8, Apple introduced a new way of managing the signing configuration. Now you have two options Manual
and Automatic
.
According to the WWDC 2016 Session about Code signing (WWDC 2016 - 401 - What's new in Xcode app signing), when you select Automatic
signing, Xcode is going to:
- Create signing certificates
- Create and update App IDs
- Create and update provisioning profiles
But according to what Apple says in that session, the Automatic Signing
is going to use Development signing
and will be limited to Xcode-created provisioning profiles.
The issue comes when you try to use Automatic Signing
on a CI environment (like Travis CI or Jenkins). I'm not able to figure out an easy way to keep using Automatic and sign for Distribution (as Xcode forces you to use Development and Xcode-created provisioning profiles).
The new "Xcode-created provisioning profiles" do not show up in the developer portal, although I can find then in my machine... should I move those profiles to the CI machine, build for Development
and export for Distribution
? Is there a way to override the Automatic Signing
using xcodebuild
?
I basically run into the same issue using Jenkins CI and the Xcode Plugin. I ended up doing the build and codesigning stuff myself using
xcodebuild
.0. Prerequisites
In order to get the following steps done successfully, you need to have installed the necessary provisioning profiles and certificates. That means your code signing should already be working in general.
1. Building an .xcarchive
DEVELOPMENT_TEAM
: your 10 digit developer team id (something like A1B2C3D4E5)2. Exporting to .ipa
Example of an
exportOptions.plist
:method
: is one ofdevelopment
,app-store
,ad-hoc
,enterprise
teamID
: your 10 digit developer team id (something like A1B2C3D4E5)This process is anyway closer to what you would do with Xcode manually, than what for example the Jenkins Xcode Plugin does.
Note: The .xcarchive file will always be develpment signed, but selecting "app-store" as method in the 2nd step will do the correct distribution signing and also include the distribution profile as "embedded.mobileprovision".
Hope this helps.
For me, nothing worked. I solved my problem by changing a file in Xcode app installed on your Mac Mini (CI server with Jenkins), as shown in this link:
https://www.jayway.com/2015/05/21/fixing-your-ios-build-scripts/
Additionally I turned off automatic signing from Xcode.
All done! Finally works!