Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mock GPS Provider only works while in Debug mode

I have been updating an app and pulling the version target forward, and we are running into an issue with GPS Mocking.

The mock locations works perfectly when debugging with android studio, but when I leave debugging and just run normally it doesn't work at all.

Background:

This is pulling GPS information over serial and mocking the device's location. This all works right up until the mocking, then the location wont be set unless I am actively debugging.

If I am missing something please let me know, it seems like some security restriction I'm not aware of holding us down.

EDIT: I still can't find anything around this, and it seems specifically when I'm stepping through the code it works, but otherwise just running doesn't work

like image 302
Samuel Avatar asked Sep 23 '16 15:09

Samuel


2 Answers

Have you checked [ro.allow.mock.location] with getprop | grep mock over adb shell?

Set it to 1 (setprop ro.allow.mock.location 1) it should work on release mode as well. It's initially 0. If that doesn't work please give me a feedback so i can change my answer.

like image 168
Burak Day Avatar answered Nov 13 '22 17:11

Burak Day


It seems as if Mock Locations REQUIRES debug mode. When creating a "release" build debug mode still had to be declared.

like image 41
Samuel Avatar answered Nov 13 '22 17:11

Samuel