I’m writing some code that uses the accounts APIs in Mountain Lion. However, I can’t find a way to make OS X completely forget that I authorized my app, so that I can test the authentication process in my app. Here’s things that don’t work:
- Disabling them in the privacy preference pane. This just revokes access.
- Removing the accounts and re-adding them. Access is to accounts, not a specific account, so an empty set of accounts still has access granted to it.
- Deleting the app (as far as I can tell, I purged all copies of it – none appeared in Spotlight)
- Running
rm -rfon theAccountsdirectory in~/Library, which contains an SQLite database that appears to contain the access permissions table (it’s been recreated by the OS, and that table is now empty, but they persist in System Preferences). - Running
rm -rfon basically every directory in~/Librarythat contains stuff about accounts.
What does work:
- Changing the app’s bundle ID. But come on. There has to be a real way to do this that won’t turn my list of applications in “Security & Privacy” into 500 copies of my app with unique bundle IDs. Also, it won’t work for Facebook because they require you to set your bundle ID on their developer site.
tccutil reset Twitter/tccutil reset Facebookshould do what you’re after.