Instantly share code, notes, and snippets.

Embed
What would you like to do?
Completely reset TCC services database in macOS 10.14b7
#!/usr/bin/python
"""
Completely reset TCC services database in macOS 10.14b7
2018-08-15: Resetting the 'Location' service fails; unknown cause
2018-08-16: Confirmed the 'All' service does not really reset _all_
services, so individual calls to each service is necessary.
"""
import subprocess
SERVICES = ['Calendar', 'AddressBook', 'SystemPolicyAllFiles', 'PostEvent',
'Willow', 'Photos', 'LinkedIn', 'Facebook', 'SinaWeibo', 'Twitter',
'Siri', 'AppleEvents', 'Camera', 'Microphone', 'PhotosAdd',
'Reminders', 'All', 'Accessibility', 'Liverpool', 'Ubiquity',
'ShareKit', 'TencentWeibo', 'SystemPolicySysAdminFiles',
'MediaLibrary', 'SystemPolicyDeveloperFiles', 'Location']
if __name__ == '__main__':
for service in SERVICES:
cmd = ['/usr/bin/tccutil', 'reset', service]
try:
subprocess.check_call(cmd, stderr=subprocess.PIPE)
print "Reset", service
except subprocess.CalledProcessError:
print "Unable to reset", service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment