Enabling Location Services Programmatically for an individual app

New Contributor II

I am trying to enable Location Services for a specific app such as Location Helper.app etc via command line for High Sierra and Mojave macOS computers. The main issue was: when we deploy the app, the user will get a prompt on whether to allow it to use Location Services data. If the user does not allow it, the app will be not getting Location Services data even if Location Services is enabled. (At our environment, everyone is an admin on their computers. Yikes!)


I was able to enable Location Services at the top level by using the following command.

sudo /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -int 1

However, I haven't figured out how to enable Location Services for a specific app yet and hope the community here can help me figure out. :)

Reference Threads
Enabling Location Services Programmatically via Casper

Enable Location Services Programmatically - 10.13+

Enable Location Services after imaging