{"id":1695,"date":"2013-08-21T10:18:14","date_gmt":"2013-08-21T10:18:14","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1695"},"modified":"2013-08-21T10:18:14","modified_gmt":"2013-08-21T10:18:14","slug":"enabling-location-services-programmatically","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1695","title":{"rendered":"Enabling Location Services Programmatically"},"content":{"rendered":"<p>Location Services is an important part of OS X, but it is not obvious on how to enable it without going through the System Preferences GUI. \u00a0The preference that controls it is not in \/Library\/Preferences, and due to cfprefsd it is hard to find.<\/p>\n<p>Thanks to Tim Sutton for help in finding where this preference lives.<\/p>\n<p>It is a ByHost preference that exists in locationd\u2019s container, at\u00a0\/var\/db\/locationd\/Library\/Preferences\/ByHost\/com.apple.locationd.$uuid.<\/p>\n<p>To enable it, use this script:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">#!\/bin\/sh<br \/>\nlaunchctl unload \/System\/Library\/LaunchDaemons\/com.apple.locationd.plist<br \/>\nuuid=`\/usr\/sbin\/system_profiler SPHardwareDataType | grep &quot;Hardware UUID&quot; | cut -c22-57`<br \/>\ndefaults write \/var\/db\/locationd\/Library\/Preferences\/ByHost\/com.apple.locationd.$uuid LocationServicesEnabled -int 1<br \/>\nchown -R _locationd:_locationd \/var\/db\/locationd<br \/>\nlaunchctl load \/System\/Library\/LaunchDaemons\/com.apple.locationd.plist<br \/>\n&nbsp;<br \/>\nexit 0<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Location Services is an important part of OS X, but it is not obvious on how to enable it without going through [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1695","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1695"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1695\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}