Page 1 of 2

Android 6 automation

Posted: 05 Nov 2018 15:33
by robchoc
I'm trying to automate an app that requires me to swipe down on the screen to refresh. Is there any way to do this on Android version 6?

Re: Android 6 automation

Posted: 05 Nov 2018 17:12
by Desmanto
You have to find other method to trigger the refresh, probably input key F5 or there is button to refresh it. Otherwise, you have to use execute root command, input swipe.

Re: Android 6 automation

Posted: 05 Nov 2018 17:57
by Wibbly
robchoc wrote:I'm trying to automate an app that requires me to swipe down on the screen to refresh. Is there any way to do this on Android version 6?
I have tried to Control UI do do the same thing in the past. It was a fail.

Re: Android 6 automation

Posted: 05 Nov 2018 18:42
by robchoc
Looks like this is something that can't be done, thanks for the replies.

Re: Android 6 automation

Posted: 06 Nov 2018 06:31
by xdauser
Execute root command with: input swipe x1 y1 x2 y2, where x1 y1 x2 y2 are coordinates of the direction you would like to swipe.

Re: Android 6 automation

Posted: 06 Nov 2018 07:48
by robchoc
No root, unfortunately.

Re: Android 6 automation

Posted: 07 Nov 2018 10:18
by robchoc
Is this a possibility to replicate gesture to swipe down.

Do a long click at a certain point and before it has had a chance to finish the click then do another one a pixel down and keep going like this so that it looks like the press never left the touchscreen?

Re: Android 6 automation

Posted: 08 Nov 2018 05:34
by Desmanto
So far, it seems there is no way to do it without that input swipe. That's why I want to upgrade to nougat phone above, when I still have Lollipop 5.1. (currently already using Oreo 8.1). While newer android introduce new restriction, but it also introduce new feature.

Better try to find another way to trigger the refresh event. You can try to connect usb or bluetooth keyboard and try to press F5, check whether the app respond to that key or not. You can also try to find the activity inside the app using start activity, to see if there is specific intent that can trigger the refresh.

Re: Android 6 automation

Posted: 08 Nov 2018 10:59
by robchoc
I tried the Bluetooth Keyboard and F5 did not refresh.

I'm interested in the second part of your reply about finding a possible intent using start activity, how do you use this action to do this?

Re: Android 6 automation

Posted: 08 Nov 2018 16:29
by Desmanto
App's activity is undocumented territory, only available if the dev of app publicly announce it. Somehow we can find the hidden activities, but not guaranteed.

Use action Start Activity, Action : android.intent.action.MAIN. Tick the explicit component and find the app. Then find the class name, search for something related to refresh, retrieve, sync or its kind. If you can't find it, you can try to search in the action Start Service or Send Broadcast. As it is impossible to check for all app, I can't guarantee it will work, just a possible workaround.