Reset/Remove all entries in Security&Privacy>Privacy [duplicate]

So I upgraded to Mojave recently and I got some app permission popups requesting access to system events, etc.

I didn't recognise some of these the apps and didn't allow access.

Now it turns out that this is being used by xcodebuild and it is failing.

How can I reset all these app permissions. So that I get the popup again and I can allow this time.

PS: I'm not asking about file permissions.


Solution 1:

Some categories, like the one you mention, aren't listed in System Preferences.

You can reset that one in particular with this command:

tccutil reset AppleEvents

Or, you can reset all app permissions like this:

 tccutil reset All

You can also add an app's bundle identifier (e.g. tccutil reset All com.apple.Terminal) to reset only that app's permissions.

Solution 2:

man tccutil

The tccutil command manages the privacy database, which stores decisions the user has made about whether apps may access personal data.

One command is current supported:

 reset    Reset all decisions for the specified service, causing apps to
          prompt again the next time they access the service. If a bundle
          identifier is specified, the service will be reset for that bun-
          dle only.

EXAMPLES To reset all decisions about whether apps may access the address book:

tccutil reset AddressBook
tccutil reset All com.apple.Terminal

Solution 3:

From the blog post "Reauthorizing Automation in Mojave":

If the user selects “OK”, the application sending the command will be thereafter whitelisted, and allowed to send arbitrary events (not just the one that prompted the alert) to the Finder. If you’re running macOS Mojave you can see a list of applications you’ve already permitted in System Preferences, under “Security and Privacy,” “Privacy,” “Automation”.

Solution 4:

Theres also a nifty tccutil replacement on github which is also available via brew.