uiautomatorviewer:Error while obtaining UI hierarchy XML file:com.android.ddmlib.SyncException:

When appium uses the simulator to do automation, click the above one, and the following error will appear
when appium uses the simulator to do automation

Solution: enter ADB root in the CMD command window.

Read More: