I have switched to a new Apple ID for development. I'm trying to build my app- via Fastlane, but here is the command I'm running plain from the Terminal:
xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination 'generic/platform=iOS' -archivePath ~/Desktop/test.xcarchive archive
It shows this error:
2024-11-17 16:53:42.620 xcodebuild[3907:31401] DVTDeveloperAccountManager: Failed to load credentials for myoldappleid@email.com: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for myoldappleid@email.com, missing Xcode-Token" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for myoldappleid@email.com, missing Xcode-Token}
The problem is that myoldappleid@email.com is the old Apple ID which I have tried to remove from my system entirely:
xcodebuild clean
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Application\ Support/Xcode
rm -rf ~/Library/MobileDevice/Provisioning\ Profiles
fastlane match nuke development
and fastlane match nuke distribution
followed by fastlane match
to regenerate -- all those logs confirmed use of the new Apple IDsecurity delete-generic-password -s "Xcode" -a "myoldappleid@email.com"
Why else would my machine be looking up credentials for my old Apple ID??
This was the solution:
defaults delete com.apple.dt.Xcode