Xcode 16 on macOS Sequoia Keeps Removing Apple Accounts

I've recently set up new M4 Mac Minis with macOS Sequoia and Xcode 16. After logging into my Apple account in Xcode, everything works fine initially. However, the next day—or sometimes just a few hours later—my builds fail, and when I check the Accounts tab in Xcode's Settings, my account is missing. I have to re-add and re-authenticate my account, only for the same issue to recur later.

To investigate further, I upgraded an older Mac Mini from macOS Sonoma and Xcode 15.1.0 to macOS Sequoia and Xcode 16.2. Unfortunately, this machine now exhibits the same behavior, suggesting the issue is related to either macOS Sequoia or Xcode 16.

Has there been a change in Xcode or macOS that causes this automatic removal of accounts? Is there a solution or workaround to prevent Xcode from removing my Apple account?

Any insights or suggestions would be greatly appreciated!

We observe exactly the same behavior on a M1 Mac mini with Xcode versions 16 - 16.2 on Sequoia as well as on a M4 Mac mini with Xcode 16.2. We wiped and reinstalled the M1 Mac mini and the problem persists.

Builds are done with xcodebuild executed in a gitlab shell runner.

Same issue here. I migrated from an Intel mac mini for my CI to an M4 mac mini. Keeps loosing the account, seems a bit random but I think it's linked to TestFlight deployments. The issue is present on the mac mini itself as well as on a VM run on that mac mini (freshly set up as well). Sequoia 15.3.2 and Xcode 16.1/16.2

And I thought I'm going crazy. Same story here, M4 Mac mini with Xcode 16.2, MacOS 15.3.2 (24D81). Using github pipelines and fastlane for iOS builds and distribution to TestFligh.

I'm also seeing exactly the same issue with Sequoia 15.4.1 and Xcode 16.2 two. I have multiple Mac Minis (M2 and currently setting up some M1s) setup as Gitlab CI runners, and the Apple IDs for code signing randomly get removed after a random period of time.

I tried running: defaults write com.apple.dt.Xcode DVTDeveloperAccountUseKeychainService -bool NO to store it outside the keychain, but this doesn't appear to make a difference.

What is interesting is when re-adding the account, I no longer get prompted for 2FA, requiring only a password, which suggests the trusted status for the account is being cached somewhere correctly...

Xcode 16 on macOS Sequoia Keeps Removing Apple Accounts
 
 
Q