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
hope this helps!
Some internals: the string android:mock_location is resolved by the AppOpsManager into an actual int and than executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With