1
votes

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?

2

2 Answers

0
votes

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
0
votes

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