Is there an ADB command to toggle Allow Mock Locat

2020-07-15 15:27发布

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.

标签: android adb
1条回答
Emotional °昔
2楼-- · 2020-07-15 15:58

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

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

hope this helps!

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

查看更多
登录 后发表回答