Skip to content

Instantly share code, notes, and snippets.

@gregneagle
Created June 9, 2017 18:53
Show Gist options
  • Save gregneagle/c0123c72ac821985a675ea18c1128f08 to your computer and use it in GitHub Desktop.
Save gregneagle/c0123c72ac821985a675ea18c1128f08 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
import pwd
from Foundation import CFPreferencesAppSynchronize
from Foundation import CFPreferencesSetValue
from Foundation import kCFPreferencesCurrentUser
from Foundation import kCFPreferencesCurrentHost
uid = pwd.getpwnam('_locationd').pw_uid
os.setuid(uid)
CFPreferencesSetValue('LocationServicesEnabled', True, 'com.apple.locationd',
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment