My Android app uses location. To test it on my physical phone with mock locations I added
android.permission.ACCESS_MOCK_LOCATION to debug manifest. To use mock locations I activated
adb shell appops set com.example.my.package android:mock_location allow.
How do I do that in travis?
I tried the same command in the
before_script:-section, but it does not work.
- android-wait-for-emulator - adb shell input keyevent 82 & - adb shell appops set com.example.my.package android:mock_location allow
Here the error message:
V/InstrumentationResultParser: java.lang.SecurityException: Requires ACCESS_MOCK_LOCATION secure setting
Of course the tests run fine in local mode and the rest of my
.travis.yml is set up correct. (Travis tests that do not require location permission run fine as well)