Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist xml xml

Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist


The best way is to kill the adb server and start it again.

  • sudo adb kill-server
  • sudo adb start-server

This will do the trick.


Currently your UI needs to be idle (as in no Accessibility Events sent) for at least 1000ms before the AccessibilityService will be able to produce the UI hierarchy dump.

If you would try to run adb shell uiautomator dump it would give you the ERROR: could not get idle state.


Even though it's late I'm giving my observation here. Even I got this issue. Before taking the screen shot from UI Automator terminate the appium server connection. Then try to capture screenshot. It works fine.