Interact Touch

212 views
Skip to first unread message

Frederik Bangle

unread,
Jan 4, 2022, 11:22:07 AM1/4/22
to Automate
Hello Henrik & others,

I am using Automate since 2 years with big flows (>1k blocks each), without any issue so far. Lately, I noticed that sometimes my flows get stuck  either on an Interact Touch block, or Interact blocks. The log just shows "2022-01-04 : XXXXXX@1046 Interact Touch" and it stays like this without any error, and doesn't do the action, I just need to stop it. I do think it's related to Accessibility, so I use the root superuser shell Enable_accessibility_services, however it doesn't fix it totally, as it's still appear. The accessibility setting is always enabled, this bug appears only for Interact/Interact Touch blocks, and happens here and there for any of them, not one in particular. 

I also use dumpsys command lines for inspection, to get the exact layout as the one with Inspect is sometimes buggy. Thing is, am I the only one having this issue with those Interact blocks since 2-3 weeks ?

I've been adding some more superuser shell blocks with dumpsys UI Layout inspect  and I'm wondering if it's the cause. I just can't seem to figure it out...

Thanks!

Henrik "The Developer" Lindqvist

unread,
Jan 4, 2022, 12:04:51 PM1/4/22
to Automate
Hmm, seems like dispatching a gesture can fail or be denied, not just cancelled. That's probably what's happening, but the block get stuck wait for a completion or cancellation callback. I'll fix that.

Frederik Bangle

unread,
Jan 4, 2022, 12:34:59 PM1/4/22
to Automate
Thank you.

I only started seeing this last 2-3 weeks ~ while using Automate since a long time, why does this happen only now with the Interact / Interact Touch blocks ?

I thought it was linked to the Superuser commands I implemented (tap X Y) with Dumpsys, but I'm glad if it's not that.

If you need any details from the logs, even if there's no error, don't hesitate.

Henrik "The Developer" Lindqvist

unread,
Jan 4, 2022, 2:04:21 PM1/4/22
to Automate
Maybe you've updated to the alpha version which now targets Android 11?

Frederik Bangle

unread,
Jan 4, 2022, 2:21:52 PM1/4/22
to Automate

Automate version is 1.30, with Android versions going from 9 to 11 (multiple phones with this same bug, appearing at the same time)

Frederik Bangle

unread,
Jan 4, 2022, 3:21:54 PM1/4/22
to Automate
Note : it persists also with last version of Automate, and with the last version of Accessibility (Samsung devices). Didn't try with alpha of Automate tho

Frederik Bangle

unread,
Jan 12, 2022, 6:40:05 PM1/12/22
to Automate
Hello Henrik,

I have been doing some tests, and conclusion is that if there are 2 fibers running (for example after a FORK), with a Dumpsys Inspect (adb superuser block) AND at the same time on the other fiber, an Interact Block, the Interact Block will fail with "No accessibility service running".

I tried the same loop without Dumpsys, it worked 100x times, and with Dumpsys, accessibility service get all the time disabled.

Any thoughts about this ?

Thanks 

Frederik Bangle

unread,
Jan 12, 2022, 6:46:11 PM1/12/22
to Automate
I could see some workaround here, but couldn't make it work.

Henrik "The Developer" Lindqvist

unread,
Jan 13, 2022, 8:13:09 AM1/13/22
to Automate
"No accessibility service running" is often caused by the app being killed, and due to an Android bug it's not being restarted properly:

Sadly there's no workaround, except trying to minimize the chance of Automate being killed.

Frederik Bangle

unread,
Jan 13, 2022, 8:33:31 AM1/13/22
to Automate
When this happens, Automate is running fine and isn't being killed. The fiber with "UI_Automator Dump" superuser block keeps running fine, while the other fiber, with the Interact Touch block, stopped running ("No accessibility service running).

I found out this answer on github :

"It is not possible to test Accessibility Services in parallel with UiAutomator.

Both UiAutomator(including UiAutomator2) and AccessibilityService depends on same resources internally which are singleton in nature and UiAutomator API always holds lock on those resources.

As a result it just not possible to use both UiAutomator and AccessibilityService at a time."

Source : https://github.com/appium/appium/issues/4910

So, if as you said, there is no workaround : how can I inspect the whole window in the foreground and get all the XML with the Views, the ID, the yexts, the coordinates,... I want to be able to fetch all of them, and then read them in a file to get the coordinates (that was why I used "UI automator dump).

Thank you !

Henrik "The Developer" Lindqvist

unread,
Jan 13, 2022, 9:33:10 AM1/13/22
to Automate
I have no idea what dumpsys accessability does, it's probably doesn't require a running service.
It's currently not possible to get the XML of all windows, just the foreground one, using the Inspect layout block.
Reply all
Reply to author
Forward
0 new messages