Android 6 automation

Post your questions and help other users.

Moderator: Martin

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Android 6 automation

Post by robchoc » 05 Nov 2018 15:33

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?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Android 6 automation

Post by Desmanto » 05 Nov 2018 17:12

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Android 6 automation

Post by Wibbly » 05 Nov 2018 17:57

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.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Android 6 automation

Post by robchoc » 05 Nov 2018 18:42

Looks like this is something that can't be done, thanks for the replies.

xdauser
Posts: 35
Joined: 05 Aug 2015 17:55

Re: Android 6 automation

Post by xdauser » 06 Nov 2018 06:31

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.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Android 6 automation

Post by robchoc » 06 Nov 2018 07:48

No root, unfortunately.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Android 6 automation

Post by robchoc » 07 Nov 2018 10:18

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?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Android 6 automation

Post by Desmanto » 08 Nov 2018 05:34

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Android 6 automation

Post by robchoc » 08 Nov 2018 10:59

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?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Android 6 automation

Post by Desmanto » 08 Nov 2018 16:29

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply