在使用uiautomatorviewer時遇到兩類Error obtaining UI hierarchy報錯,分別是:
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
Error taking device screenshot: EOF
解決方法
嘗試過很多網上查找的方法,有說是Appium影響的,最后還一言不合把Appium也卸載了,但是還是無果。其實問題根源很簡單。是電腦端的adb版本過高導致 ┓( ´∀` )┏
執行adb shell getprop ro.build.version.sdk,查看手機sdk版本為28,而電腦安裝的platform-tools是29,看來adb版本過高也不可以。最后重新下載個28版本即可搞定(๑•̀ㅂ•́)و✧