How can I disable locations in Android 11(API 30) using adb shell command

Viewed 867

The following commands do not disable location services on API 30. Although they do work on other API levels.

adb shell settings put secure location_providers_allowed -gps
adb shell settings put secure location_providers_allowed -network

They do not throw any error message, but they do not turn off the location services either.

1 Answers

These are the commands you should use

(to enable):

adb shell settings put secure location_mode 3

(to disable):

adb shell settings put secure location_mode 0
Related