Reputation: 11
Since I changed my certificate,I cant build anymore with xcodebuild.
I can build and export using xcode archive and organizer without issues. My private key is installed correctly.
But, when I use xcodebuild manually from the terminal, it first throw errors I don't fully understand and then says that I dont have a private key for my certificate.
Here is the xcodebuild command I use
terminal% /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -verbose -scheme MyApp -workspace MyApp.xcworkspace -configuration Release clean archive -archivePath _build/MyApp.xcarchive -allowProvisioningUpdates
Here is the error
2020-12-03 07:57:01.238 xcodebuild[4658:241714] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17535/IDEFoundation/Provisioning/Logging/IDEProvisioningLedger.m:172 Details: Unable to close provisioning ledger entry because not all of its subentries are closed Object: <IDEProvisioningLedgerEntry: 0x7ff4f0a54e00> Method: -closeWithError: Thread: <NSThread: 0x7ff4ef32abc0>{number = 11, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
followed by
error: Revoke certificate: Your account already has an Apple Development signing certificate for this machine, but its private key is not installed in your keychain.
I read a lot of posts from people that have a similar issues
I don't know what to do right now to fix the problem apart from re-installing macos completely :(.
PS:
The build machine originally use jenkins 2.244. The error is the same with jenkins.
The version of xCode is Version 12.2 (12B45b)
The os is Catalina 10.15.5 (19F101)
Thank you
Upvotes: 0
Views: 471
Reputation: 11
The solution was so simple I'm quite ashamed to have lost this much time on this issue.
The command is building for release so I checked the private key of the distribution certificate and I did not install the developement certificate.
I was so focused on this idea that I did not look back and say "Oh it is talking about developement for a reason (a dumb one) even if I build for distribution"
I just added the Developement certificated and private key to the keychain and it works.
Sow now, I learned that xcodebuild will need the dev certificate and key even when building for distribution.
Upvotes: 1