How to install android 6.0 location app from adb

I would like to install the " mock location app " without user intervention, so I can partially automate some tests on Android 6.0.

geo fix does not fit in my situation.

Is it possible?

+5
source share
2 answers

For Android 6.0+:

Allow app for locaiton layout

 adb shell appops set <PACKAGE> android:mock_location allow 

Uninstall a location app

 adb shell appops set <PACKAGE> android:mock_location deny 

Check if the location app is installed

 adb shell appops get <PACKAGE> android:mock_location 
+2
source

My best team and I could do is create a separate application that sets up false locations. This application runs from a set of tests. We use the UI machine to launch the location application. The only caveat here is that you need to manually install the location app once and manually install it as a location app.

0
source

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


All Articles