Archive for November, 2020

android: enable and disable location providers from command line

November 4, 2020

This post discuss enabling and disabling location providers from command line.

environment

[ro.build.version.release]: [9]
[ro.build.version.sdk]: [28]

command

% adb shell settings put secure location_providers_allowed +gps,+network
$ adb shell settings get secure location_providers_allowed
gps,network
% adb shell settings put secure location_providers_allowed -gps,-network
$ adb shell settings get secure location_providers_allowed

note
This settings works from Android 6 to Android 9. But it doesn’t work in Android 10.