Search code examples
bambooxcodebuildcode-signing-certificate

xcodebuild: No certificate matching <cert name> for team


We have an macOS Xcode project that is built from scripts triggered by Bamboo CI. Recently, our builds have recently started failing with this message:

No certificate matching 'cert name' for team 'team id': Select a different signing certificate for CODE_SIGN_IDENTITY, a team that matches your selected certificate, or switch to automatic provisioning.

Our project uses manual codesigning, and our build command is as follows:

xcodebuild -project ProjectName -target TargetName -configuration Release 
CODE_SIGN_IDENTITY="Certificate Name" APP_VERSION="major.minor"
REVISION_NUMBER="build" CONFIGURATION_BUILD_DIR="output directory"  
DEVELOPMENT_TEAM=${developmentTeam}

Upon running this instruction in the build script, the build fails at the Check Dependencies step with the aforementioned error message.

Running the build script locally works and the build completes successfully. This indicates that Bamboo is unable to see the signing certificate. What should I do to make the relevant certificate visible to Bamboo?

I've made sure of the following:

  • None of the certs are expired
  • The build is not waiting on a codesign dialog box

NB: Builds from as late as yesterday (Sept 11) have been successful, but those are from a different Bamboo plan branch. There have been several code changes between the branch I am building now and the previously successful branch, but none involving the project I am building.


Solution

  • Turns out it was my mistake.

    The bamboo agent was started from a ssh prompt, causing it to be unable to see certificates for some reason, even though I was logged in as a local user (similar to this problem). Stopping the bamboo agent, then restarting it from a local terminal on the build server caused the bamboo agent to see the certs again, and builds to complete successfully.

    I'm leaving this here in case others run into this problem and find this solution useful.