Error in using UIAutomatorviewer for testing Android app in Appium

Rancho picture Rancho · Aug 8, 2014 · Viewed 47.2k times · Source

I have to automate an Android application, I am doing the same through Appium.

The problem I am facing is after launching the Appium server, the app is getting installed in the emulator 4.4.2. To inspect the element I am using UIAutomatorviewer which comes default with SDK. But while inspecting the element of the app, I am getting the error:

Error obtaining UI hierarchy
Reason:Error while obtaining UI hierarchy XML file.com.android.ddmlb.SynchException.Remote object doesn't exist.

I tried to find the solution so that I can inspect the element so that I can script, but in vain.

  1. Can someone please tell how to fix the issue so that I can inspect elements?
  2. Is there any other way I can inspect element in the app apart from using UIAutomator viewer?

Answer

Rancho picture Rancho · Aug 11, 2014

After my tryst with the uiautomator viewer i came to know that we get the error only when:

appium server is running and we try to capture the screenshot using uiautomatorviewer.

So, whenever you want to use uiautomatorviewer make sure that server is in stopped state.