3

I get the following error when using the XCodeBuild plugin of jenkins:

Code Sign error: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains

Update: I am able to xcodebuild from terminal and build in xcode to simulator and to device however not when running it in jenkins - jenkins seems to have some different 'shared' osx user because its home folder is in users/shared?

TheLearner
  • 19,387
  • 35
  • 95
  • 163
  • What does your build command look like in jenkins? – mkral Dec 14 '12 at 16:24
  • please try following link which may help you. http://stackoverflow.com/questions/13614657/code-signing-error-running-xcodebuild-in-jenkins – Girish Dec 14 '12 at 16:29

4 Answers4

3

By default when Jenkins is installed it runs as a daemon as opposed to a process under your current user. As such it does not have access to any of your credentials which are needed to code sign your app.

Instead of running Jenkins as a daemon, you should just launch it like a normal process. It would probably looks like something like this:

java -jar /Applications/Jenkins/jenkins.war
Luke The Obscure
  • 1,524
  • 2
  • 20
  • 35
  • Alternatively see: http://stackoverflow.com/questions/6827874/missing-certificates-and-keys-in-the-keychain-while-using-jenkins-hudson-as-cont/9482707 – AlexD Jun 03 '13 at 20:50
2

THe build machine you are using does not have the private key that matches the certificate that is inside the Provisional profile.

mskw
  • 10,063
  • 9
  • 42
  • 64
  • 1
    I am using my local machine but it seems to create a 'shared' user - xcodebuild works fine from command line and in xcode but not when jenkins calls it – TheLearner Dec 16 '12 at 17:46
  • Jenkins can use a script for additional options, one of them is profiles. Make sure the profile is the correct one. – mskw Dec 17 '12 at 19:11
1

I also run jenkins as a daemon and code signing works fine using the plugin:

https://wiki.jenkins-ci.org/display/JENKINS/Keychains+and+Provisioning+Profiles+Plugin

(Jenkins 2.19.1 with Xcode 8)

Emmanuel
  • 323
  • 2
  • 3
0

It's not the build machine, but the user doing the build. He's missing those certificate and private key. You need to manually add a login.keychain especially for him.

JOM
  • 8,139
  • 6
  • 78
  • 111