Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code signing identities not found in Xcode server

Using Xcode 7B4 and Server 5B4 with a Carthage project. To build the project I need to first build it's dependencies. So I added a Before Integration step to the bot with the following code:

echo "Bootstrapping dependencies..."
export PATH=$PATH:/usr/local/bin
cd Alchemic
carthage bootstrap --use-ssh --use-submodules
echo "Ready."

Running this myself everything works. But when the bot runs it I get this:

CodeSign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
CodeSign error: code signing is required for product type 'Framework' in SDK 'iOS 9.0'
A shell task failed with exit code 65

Checking the bot I have myself as the team and scanning the servers directories it appears to have all the required provisioning files. So I'm guessing that Server's user does not have access to the keys or something like that.

Does anyone have any idea what I might be missing?

like image 643
drekka Avatar asked Jul 27 '15 03:07

drekka


2 Answers

I had a similar issue. The solution for me was:

  1. From Xcode on your local machine, open Preferences -> Accounts -> double click on the team associated with your apple ID (you need one :) ) -> in the Signing identity panel, select an identity and click the cog icon to export. Save this to a file.
  2. Upload the generated .p12 file to your build machine, and add it to the System keychain (not to the user's) by dragging it to the Keychain Access window
  3. On the build machine Keychain Access, navigate to the certificate(s) you just installed (it should be under System -> Certificates) and click the arrow next to the name to expand and see the private key. Right click on the key -> Get info -> Access control tab, and either allow all apps to access this item (probably unsafe) or add the codesign app to the list of applications that are allowed to use this key
  4. Make sure, on Server on the build machine, that the XCode section is enabled and added to the corresponding development team for that certificate.
like image 93
Marco83 Avatar answered Oct 19 '22 09:10

Marco83


I ran into similar issues with Xcode Server bots and code signing. I'm running Server 5.1 and Xcode 7.3. What ultimately helped me work through them was this blog post: http://matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/

Namely, the parts of the post most helpful were:

  1. Make sure that your provisioning profiles are copied into the Xcode Server directory located at: /Library/Developer/XcodeServer/ProvisioningProfiles/ Xcode Server can't see the profiles that Xcode automatically downloads from the developer portal to ~/Library/MobileDevice/Provisioning Profiles. You can either copy those into place or manually download them from the web and move them over.
  2. Make sure the signing key (private key) and certificate are in the System keychain. Again, Xcode creates these within the context of your user account. If you generated them with Xcode on the server, then simply copy them from your login keychain to the System one. If you are importing from other computer using a .p12, make sure you import to the System keychain in Keychain Access.

For more detail, check out that blog post. It really helped me.

like image 32
Mark Suman Avatar answered Oct 19 '22 10:10

Mark Suman