Command-line signing fails while signing from Xcode succeed

Hi,

I'm currently trying to build my project from command line using Jenkins automation.

However, although both methods are using the same code sign parameters, the UI based signing (from Xcode) succeed and when running from xcodebuild it fails for the reason below :

Code Block
/usr/bin/codesign --force --sign <my_cert_id> --timestamp\=none /Users/bla/file.dylib

and the result is :

Code Block
Warning: unable to build chain to self-signed root for signer "Apple Development: userBuilder (...)"
/Users/bla/file.dylib: errSecInternalComponent


But the same command runs successfully when being invoked from Xcode. My questions are

  1. Do the certificate+private key are taken from the keychain in both cases ?

  2. Are there are environment variables that may exist only in the Xcode mode ?


thanks

I'm currently trying to build my project from command line using
Jenkins automation.

My general recommendation here is:
  1. Get things working in Xcode (which you’ve already done).

  2. Then convert that to command-line signing in Terminal (specifically, on the same Mac, and with the same user account, as you’re using for Xcode).

  3. Finally convert that to your CI system.

The advantage of doing step 2 is that it confirms that the problem you’re having is not with command-line signing per se but rather with your CI system. You can then escalate this via the support channel for your CI system.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Command-line signing fails while signing from Xcode succeed
 
 
Q