2

The XCode plugin seems to make the assumption that only keychains from the user jenkins can be used for signing XCode builds.

There is a section called Keychain path, however if I enter into there the following,
/Users/Me/Library/Keychains/login.keychain

then the build logshows the following:

"Will not set default: file /Users/Shared/Jenkins/Library/Keychains/Users/Me/Library/Keychains/login.keychain does not exist"

So the plugin has appended what I entered onto /Users/Shared/Jenkins/Library/Keychains/.

If I leave it as the default value of

${HOME}/Library/Keychains/login.keychain 

then the build log says:

"Will not set default: file /Users/Shared/Jenkins/Library/Keychains/login.keychain does not exist"

Thus the XCode build plugin is forcing users to be Jenkins - which means its necessary to set up a keychain as the user Jenkins? In which case, how is this done - when Jenkins is installed onto a Mac it by default creates a user called jenkins but AFAIK this is an anonymous user and its not actually possible to logon to the machine as the user jenkins. Therefore how are keychains for the user jenkins created?

Why does the plugin force this, and why is none of this aspect of things documented?

If I can use a keychain from a different user then how? - its not documented.

2 Answers 2

2

Leave jenkins default as-is, create folder /Users/Shared/Jenkins/Library/Keychains and place there a file called login.keychain.

That file you can create using Keychain Access, via menu item File - New Keychain.... What you put in there is the missing certificate with the related private key.

2
  • I don't understand how I can create that file using Keychain Access when I can't actually log in as the jenkins user. Jul 30, 2013 at 15:44
  • Create it as a different user. The only thing that matters is the content of the file, not who created it.
    – JOM
    Aug 7, 2013 at 9:08
0

I've given up on that plugin for this and couple other reasons, and I am running my Xcode build and signing from the command line, with "Execute Shell" step.

xcodebuild -verbose -alltargets -configuration Debug clean build CODE_SIGN_IDENTITY="${CODE_SIGN_IDENTITY}" PROVISIONING_PROFILE=${PROVISIONING_PROFILE}
&&
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/client_trunk/build/Debug-iphoneos/${Application}.app" -o "${WORKSPACE}/client_trunk/build/Debug-iphoneos/${Application}-Debug-${shortVer}.${revVer}.ipa" --sign "${CODE_SIGN_IDENTITY}" --embed "/Users/[youruser]/Library/MobileDevice/Provisioning Profiles/${PROVISIONING_PROFILE}.mobileprovision"

Above, ${CODE_SIGN_IDENTITY} is the one that looks like iPhone Developer: blah And ${PROVISIONING_PROFILE} is the hex number for the profile like F152C66E-B99A-47F6-B262-376CE4403D71

To address your keychain problem try this:

security default-keychain -s <keychain-name>.keychain

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.