androidtestingcompatibilityandroid-uiautomatoraccessibilityservice

Are UiAutomator and AccessibilityServices not compatible?


I have an AccessibilityService (AS) running to programatically get information about what's currently displayed on the screen.

Now I want to set some UiAutomator test cases. However, if I have the AS running the UiAutomator gives the following error:

INSTRUMENTATION_RESULT: shortMsg=java.lang.SecurityException

INSTRUMENTATION_RESULT: longMsg=Permission Denial: getIntentSender() from pid=9700, uid=2000, (need uid=1000) is not allowed to send as package android

I've searched the web and I've found that lots of people have encountered this problem but no solution for it.

So is this a lack of compatibility issue or is there a way to solve it (or at least a work-around)?

Note: If you have other thoughts in how to read/access the contents of the screen without the AS I'm all ears (more eyes in this case...) but I've looked a lot for other solutions and this is the only one I got.

Thanks in advance.

If you need more information please tell me.


Solution

  • This is an old question but I've figured I'd answer myself saying that they are indeed incompatible.