Why xcodebuild in Xcode 16 in our CI logs out the Apple ID and creates a new one

Hello,

We use automatic signing and Fastlane on our CI. Fastlane uses xcodebuild to create an archive.

xcodebuild -workspace ourApp.xcworkspace -scheme app-dev -destination generic/platform=iOS -archivePath app-dev.xcarchive -skipPackagePluginValidation -allowProvisioningUpdates -authenticationKeyID OurAppStoreConnectAuthKey -authenticationKeyIssuerID OurAppStoreConnectAuthKeyIssuerId -authenticationKeyPath /path/to/OurAppStoreConnectKey.p8 clean archive

All works fine, but ....

Why does Xcode 16 log out logged Apple ID and create a new every build? As a result, we have more and more Unknown Apple IDs in Xcode, and for each of them an error appears in log.

Error:

xcodebuild[3174:1804334]  DVTDeveloperAccountManager: Failed to load credentials for 0A1DF15C-ETC-ETC: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for 0A1DF15C-ETC-ETC, missing Xcode-Username" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for 0A1DF15C-ETC-ETC, missing Xcode-Username}

Of course, the originally logged-in Apple ID has an error corresponding to his non-logged-in state.

xcodebuild[3174:1804334]  DVTDeveloperAccountManager: Failed to load credentials for originally_logged-in_user: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for originally_logged-in_user, missing Xcode-Token" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for originally_logged-in_user, missing Xcode-Token}

Why does this happen and how can it be fixed? Why does Xcode 16 log out its logged Apple ID?

Answered by DTS Engineer in 808032022

Please file a bug report about this issue using Feedback Assistant then post the Feedback number here.

Please file a bug report about this issue using Feedback Assistant then post the Feedback number here.

I have encountered the same problem, guys. Is there a solution

@AdamShi , @Carrione You can workaround this issue by running the following command in Terminal:

defaults delete com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists

defaults delete com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists

is a workaround and deletes the developer account stored in Xcode. However, the error will still occur after you re-add it. Is there a temporary solution or more details about the error?

FB15700530

Apple Code Level Support: Case-ID: 9935876

Hello @En-iNgo , we are also facing a similar issue. Are you able to get any solution or workaround for this?

Why xcodebuild in Xcode 16 in our CI logs out the Apple ID and creates a new one
 
 
Q