Sorry, I am too lazy to google yesterday. I check again in Bliss Nougat 7.1, there is the option. Android MM 6.0+ will have that additional setting and I am still using LP 5.1
Try to check If you have that option to set the value in Set System Setting. Set first your mock app to fakegps. Then use
action :
Set System Setting
Category :
Secure
Name : tap the ellipsis and find "mock". If you can find the packaganame of fakegps, then you can use this.
However, AFAI-Research, there is no setting database to set the mock app. So you have only last resort of using Control UI to do it, but you will have some UI distraction. Use Launch app, Choose 'Setting', and class name find the 'Developer', to launch developer options. You probably need several scroll to reach the mock app selection.
Control UI require accessibility and draw over other app permission, make sure you have granted it.
- Open Control UI, use the "Show Overlay Control" and it will popup INFO and CLOSE (and GESTURE if you are using Nougat above).
- Leave the Control UI open, press home and Go to the developer option.
- Tap the INFO to show the element and tap on one of the element from the list. Try to see if there is option to select something start with scrollForwardById().
- Tap that to copy to clipboard. If there is no element with that name, press back and try to tap another one until you get it.
- Go back to automagic and paste that to the Control UI. Save and close.
- Try to execute the flow, it should open developer option and scroll forward once.
- When I test this in Bliss, opening the developer option has some delay (probably the animation), so I have to add sleep(200) before the script to make sure it works.
Now check that after the scroll, do you see the "Select mock location app option"? If no, you need to copy that scrollForward script and paste it again, so it scroll twice. Put sleep(200) in between to make sure the script works properly.
- If yes, as I tested in the bliss, then back to Automagic and open the same Control UI and Show Overlay control again.
- Execute the flow again, to land exactly at the place where you can see the option.
-Tap the INFO and tap that "Select mock location app", choose the one with click("Select mock location app").
- Press back to hide the green layout and tap that "Select mock location app" so you can see the choice of your two apps.
- Tap the INFO again and tap the Fake GPS one, choose the click("Fake GPS") or whatever the exact name of the app.
- Press back and go back to automagic Control UI, past the script.
- Try it out, you should see the it scrolled and automatically click the select mock and tap the Fake GPS.
- If you confirm it is working properly, you can try to reduce the sleep to lower value, so the script execute faster. You need to experiment with this, or you can see my index, at "How much sleep I need". Usually 200 is fine for most devices.
- Additionally, you can add another back button at the end of the script, so it automatically exit from the setting after it has done its job.
The full script when I test it in Bliss :
Code: Select all
sleep(200);
scrollForwardById("android:id/title");
sleep(200);
click("Select mock location app");
sleep(200);
click("Fake GPS");
sleep(200);
back();
I plan to make to a complete tutorial on how to use Control UI. But there are so many things to cover. I simply know how to use it intuitively, but still too awkward to explain it in wording, as you can see in this post (means I haven't fully understand it). Making video tutorial is not my style. I should make use of my screenshot flow to document it then. It will be this weekend target.