0
votes

I am trying to sign and archive my Unity application with Jenkins. I have the Xcode jenkins plugin installed and everything seems to run well except for a strange problem.

During the xcodebuild phase, when the archive should be signed, I get the following error:

error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "QF6V2M666X" with a private key was found. (in target 'Unity-iPhone')

Now the problem is that I am not trying to build for development, but for production. I have a production provisioning profile used, which is pointing the production certificate. The team id is the production team id (changed here for security reasons). Here is another part of the build output:

Going to invoke xcodebuild:, scheme: Unity-iPhone, sdk: DEFAULT, project: DEFAULT, configuration: Release, clean: NO, archive:YES, consolelog:YES, symRoot: DEFAULT, buildDir: DEFAULT, developmentTeamID: QF6V2M666X

[sr-ios] $ /usr/bin/xcodebuild -scheme Unity-iPhone -configuration Release archive -archivePath

When I open the project in Xcode, I can see that for some reason Xcode selects "IOSDeveloper" in the code signing identities part and not "IOSDistribution" (or the actual certificate in the provisioning profile): enter image description here

I don't know if this can be changed from Jenkins, but I think Xcode should pick this up from the provisioning profile.

1
Hmm I had a similar problem with Bamboo. There I create one script which changes all the signings manually. But I think there is an easier way with fastlane. - m1sh0
@m1sh0 Do you know if and where the code signing identity setting is stored in the xcode project? - Ran
I don’t remember exactly, but you can find it easy if you are using git(or van or anything similar).Just open last version of your code and from Xcode change the code signing, than git status, git diff will show you the exact place. After that you need script to replace the value. - m1sh0

1 Answers

0
votes

So I managed to find the problem and solve it, here is the solution for others.

In Unity 2018 they added a new option to the iOS player settings, in the "Other settings" section, called IOS Provisioning Profile->Profile type: enter image description here

This option is used to select the signing identity. I guess you can use "Automatic" but in my case, since I am using Jenkins, I am setting it on a build script like this:

PlayerSettings.iOS.iOSManualProvisioningProfileType = ProvisioningProfileType.Distribution;

When this option is set, xcode is able to sign the app correctly for distribution.