本文介绍了无法使用"adb shell settings put"(设置的"adb shell settings put")设置location_providers_allowed的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下命令打开位置:

I'm trying to turn location on using the following commands:

adb shell settings put secure location_providers_allowed gps,wifi,network
adb reboot

但是它既不会更改变量 location_providers_allowed 的值,也不会在重启后在Android设置用户界面下将其打开.

But it's neither changing the value of the variable location_providers_allowed nor turning it on under Android Settings UI after the reboot.

我尝试了相同的命令来设置其他变量,例如模拟位置,并且它没有任何问题.这个变量不能更改吗?

I tried the same command to set other variables, like mock_location, and it worked without problems.Is this variable not possible to be changed?

Android版本:M

Android version: M

推荐答案

对于Android 6.0

For Android 6.0

要启用使用:

对于GPS:adb shell settings put secure location_providers_allowed +gps

对于网络:adb shell settings put secure location_providers_allowed +network

要禁用:

GPS:adb shell settings put secure location_providers_allowed -gps

对于网络:adb shell settings put secure location_providers_allowed -network

这篇关于无法使用"adb shell settings put"(设置的"adb shell settings put")设置location_providers_allowed的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:42
查看更多