【问题标题】:How can I disable locations in Android 11(API 30) using adb shell command如何使用 adb shell 命令禁用 Android 11(API 30)中的位置
【发布时间】:2025-08-27 00:50:01
【问题描述】:

以下命令不会禁用 API 30 上的定位服务。尽管它们确实适用于其他 API 级别。

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

它们不会抛出任何错误消息,但它们也不会关闭定位服务。

【问题讨论】:

标签: android shell adb


【解决方案1】:

这些是你应该使用的命令

(启用):

adb shell settings put secure location_mode 3

(禁用):

adb shell settings put secure location_mode 0

【讨论】: