Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncExc
How to resolve
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
Try Restarting your device, which worked in some cases.
run below command:
adb shell am force-stop com.android.ddmlib
If you find some other solution, please do the comment or contact us to revise this post.