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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.