Set false GPS location on Android device

I am working on automation of testing devices and servers on different Android devices. I need a way to install a specific GPS lat / long on a real Android device that can be used within NUnit. Any help on this would be appreciated.

0
source share
1 answer

In the developer’s settings you need to set the Allow location layout. After that, you can write a small utility application in which the layout of the location will be set upon receipt of a specific user event.

Then you can set the location using adb shell command like

$ adb shell am start -a android.intent.action.SET_CUSTOM_MOCK_LOCATION -d gps://lat-long 

You can get this information in your utility application and set the local location. Hope this helps

+2
source

Source: https://habr.com/ru/post/1246173/


All Articles