Proceed at your own risk (and joy).
macOS 12.6 Monterey
Signed out of an iCloud account. Attempting to sign in to another iCloud account (or even the original iCloud account) failed silently and repeatedly, even after rebooting. Creating a new macOS user account and signing in to iCloud therein worked as expected, but the prospect of manually migrating over user data and settings (while not borking the now-functional iCloud sync) was not especially congenial.
The ability to sign in to iCloud under the orignal macOS user account was restored thanks to nikhilgohil11's suggestion from 2019:
The urtext for this answer appears to be from 2015 by Kurt Lang, who credits Apple support. richard2's 2016 post mentions signing out of iMessage and FaceTime as well as disassociating the Apple ID from your macOS user account (if they were previously linked) beforehand.
defaults delete MobileMeAccounts with deleting/moving the sqlite databases in ~/Library/Accounts/ like so:
sudo -v ; killall -9 accountsd com.apple.iCloudHelper ; defaults delete MobileMeAccounts ; mkdir ~/Library/Accounts/Backup ; mv ~/Library/Accounts/*.sqlite* ~/Library/Accounts/Backup/ ; killall -9 accountsd com.apple.iCloudHelper ; sudo reboot
went untested; this report did not inspire confidence.
Deleting ~/Library/Preferences/MobileMeAccounts.plist and the contents of ~/Library/Accounts/ sounded infelicitous, given that it "will cause every account you have setup in the Internet Accounts System Preferences pane to be deleted".
/mac | Oct 08, 2022
Subscribe or visit the archives.