'Teamcity - CI/CD - iOS - xcodebuild - signing - No signing certificate "iOS Development" found

I have Teamcity installed with an Agent on a MAC. When I try to build the iOS project I have this error:

error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "#######" with a private key was found. (in target 'App' from project 'App').

I use this command line:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ios/App/App.xcworkspace -scheme App clean build

I did test the command in a terminal directly on the mac and it Works! My certificates are located in the keychain in the session of the user that runs the Agent of Teamcity.

I did try to put the certificate in another keychain and grant access to the process that is executed by Teamcity using this command :

security unlock-keychain -p [password] ~/Library/Keychains/teamcity.keychain-db

Any ideas?



Solution 1:[1]

Managed to solve this. The issue was that for some reason teamcity was looking at System keychain, and of course found nothing. Adding certificate to the system keychain resolved this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vaskea