是否有ADB命令来切换“允许模拟位置”? [英] Is there an ADB command to toggle Allow Mock Locations?

查看:580
本文介绍了是否有ADB命令来切换“允许模拟位置”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了一些主题,但没有找到答案。我不需要指定纬度/经度,而是切换允许模拟位置的位置。

I've searched through some topics but haven't found an answer. I need not to specify lat/long but turn the switch of allowing mock locations.

推荐答案

在棉花糖(及更高版本)中,您之后已经安装了您的应用程序,只需运行:

In Marshmallow (and above) after you have installed your app, just run:

adb shell appops set com.example.my.package android:mock_location allow

希望这会有所帮助!

某些内部结构:字符串android:mock_location由AppOpsManager解析为实际的int,然后执行。

Some internals: the string android:mock_location is resolved by the AppOpsManager into an actual int and than executed.

这篇关于是否有ADB命令来切换“允许模拟位置”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆