Android UI Automator Viewer is not working

Throwing below error in UI Automator Viewer when taking device screenshot.

Error while obtaining UI hierarchy XML file: Remote object doesn’t exist!

Please tell me how to resolve this issue.

Is that happening on all screens?

You probably have an animation going on on that specific screen, right!

If you cannot remove the animation temporarily or get resource-ids any other way, then run code in debug mode and in evaluate expression mode on your IDE, get page source in order to know all attributes you need.


also make sure that Android layout you trying to inspect does not have “FLAG_SECURE” value which does not allow you to make screenshot.

we have such in client and disabled this when checking does client in debug mode or not.