1

When I try to build my iOS XCode project in Jenkins I get the following error:

=== CLEAN NATIVE TARGET MyTarget OF PROJECT MyProject WITH CONFIGURATION Debug === Check dependencies [BEROR]Code Sign error: The identity 'iPhone Developer: My Name (xxxxxxxx)' doesn't match any valid, non-expired certificate/private key pair in your keychains

After reading some articles (like this and this) I've ensured that the login.keychain is present using:

MacMini:Keychains jenkins$ security list-keychains
    "/Users/Shared/Jenkins/Home/Library/Keychains/login.keychain"
    "/Library/Keychains/System.keychain"
MacMini:Keychains jenkins$ 

and that the SessionCreate=true is present in my /Library/LaunchDaemons/org.jenkins-ci.plist

PS. I would highlight the fact that the XCode running on my mac mini is successfully building the project,but if I run the command

/usr/bin/xcodebuild -target MyTarget -configuration Debug clean build

...I still get the same error message. Any idea?

Community
  • 1
  • 1
Claus
  • 5,662
  • 10
  • 77
  • 118

2 Answers2

0

Try to run the xcodebuild command with a selected scheme.

Edit: Instead of

/usr/bin/xcodebuild -target MyTarget -configuration Debug clean build

do this

/usr/bin/xcodebuild -scheme MyAwesomeScheme clean build
dasdom
  • 13,975
  • 2
  • 47
  • 58
  • In the original project I have 2 schemas "MyProject Develop", "MyProject adHoc" and 2 Targets. but when I run xcodebuild -scheme "MyProject Develop" it says there is no schema with that name – Claus Nov 08 '12 at 18:41
  • Use the one for the build you want to do. Which scheme is for Debug builds? – dasdom Nov 08 '12 at 18:44
  • "MyProject Develop" but if I run it it says: "xcodebuild: error: The project 'MyProject' does not contain a scheme named 'MyProject Develop'." – Claus Nov 08 '12 at 18:46
  • Try to check the checkbox 'shared' at the scheme in manage schemes. – dasdom Nov 08 '12 at 18:48
0

To fix this problem I had to check the "unlock keychain" option in the Jenkins job configuration (providing the password).

Claus
  • 5,662
  • 10
  • 77
  • 118
  • @dasdom :anyway now there is another problem which I reported in http://stackoverflow.com/questions/13295773/error-building-ios-app-on-jenkins-macosx-server – Claus Nov 08 '12 at 18:55