Skip to content

Instantly share code, notes, and snippets.

View acodega's full-sized avatar

Adam Codega acodega

View GitHub Profile
@jhbush
jhbush / enable_location_services.zsh
Created December 15, 2022 17:26
Enables location services and sets date and time automatically.
#!/bin/zsh
# Enable Location Services script
# Find the device UUID
uuid=$( /usr/sbin/ioreg -d2 -c IOPlatformExpertDevice | /usr/bin/awk -F\" '/IOPlatformUUID/{print $(NF-1)}' )
# Enable macOS Location Services
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -int 1
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1