Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:57:43+00:00 2026-06-15T04:57:43+00:00

[Not a duplicate of similar questions as explained further down] I’m getting a code

  • 0

[Not a duplicate of similar questions as explained further down]

I’m getting a code signing error when running XCodeBuild from within Jenkins but it will build ok from the command line or from within Xcode.

Several people have had this problem in the past and the common theme with them is that Jenkins gets run at launch time as the daemon user and thus tries to access the system keychain.
The solutions that people have applied are copying credentials to the system keychain or running a command to set which keychain to use.

However in my case if I look at launchd in the Activity Manager the user is showing up as the user I am logged onto the machine as, therefore Jenkins should be running as this user and not as the daemon user.

I tried setting which keychain to use by adding this command to the Jenkins script before running XCodeBuild

security list-keychains -s /Users/[user]/Library/Keychains/login.keychain

But that did not solve the problem.

The error I am getting is:

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

So I tried moving the credentials to the system keychain but now get this error in Jenkins, but its still fine from the command line:

Code Sign error: Provisioning profile 'F152C66E-B99A-47F6-B262-376CE4403D71' can't be found

Also when I move the credentials to the system keychain I am no longer able to build from within XCOde – I get the same error as the top error message above.

I’ve also tried editing the org.jenkins-ci.plist file to set the user as who I’m logged onto the machine as, in accordance with this, but that too had no effect.

Missing certificates and keys in the keychain while using Jenkins/Hudson as Continuous Integration for iOS and Mac development

Any ideas what I could try next?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:57:44+00:00Added an answer on June 15, 2026 at 4:57 am

    I feel for you as the last time we messed with this it was quite the challenge. We did this when we set up a CI server for a project. If I remember correctly (broadly) we followed these steps:

    1) Set Jenkins up as a developer on the Apple Dev account

    2) Created a cert and dev provisioning profile specifically for Jenkins

    3) Setup a Jenkins user on the CI Server and delete any previous certs/prov profiles from xcode for that user

    4) Add the Jenkins cert to the AD-Hoc Dist Profile (If you are trying to distribute an .ipa to HockeyApp you will need to to this for an archive build.)

    5) Go into the xcode project file and delete any existing references to Provisioning Profiles

    6) Download and Install the certs for this user and the appropriate Prov Profiles.

    7) Before the build unlock the Jenkins user keychain. Do this only if the Jenkins user is not the user running the xcode build.

    Verify that Xcode shows the Prov Profile as valid in the organiser when logged in as the Jenkins user.

    I know my answer is somewhat vague and my intent is to be helpful. This type of error is usually caused by one of three things. Xcode cant find the profile, Xcode cant find the cert or Xcode found more then one profile (supposed to produce a different error but doesn’t always) and has a mismatch of some kind. Usually redoing the Prov Profiles is the least painful solution.

    Best of luck man. You will solve it it’s just a huge headache!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not a duplicate post. I've looked through similar questions on SO but
There are similar questions about On Error Goto x not catching all errors etc,
I know there are questions on here similar to this, but I have not
I'm trying not to duplicate questions obviously as I have seen some questions/answers regarding
I saw this question and some similar and I think it's not duplicate :
I know there are very similar questions but im not sure that any of
I've seen similar questions asked and the answers were not quite what I'm after.
I have spent quite some time going through similar questions here and have not
I found 2 similar questions and tried to run the code given as solution
This question is similar to but different from other SO questions involving removal of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.