Reason:(原因:)
Unexpected error while obtaining UI hierarchy(獲取UI層次結構時出現意外錯誤)
Details:(細節:)
java.lang.reflect.InvocationTargetException(調用目標異常)
照顧像我壹樣英語不好的小盆友
本人是安卓9.0的系統,因為uiautomatorview 不兼容安卓8.0以上版本所以報錯,8.0以下可以正常使用。
1.截取uix文件
adb shell uiautomator dump /sdcard/sc.uix
adb pull /sdcard/sc.uix
2.截取截圖
adb shell screencap -p /sdcard/sc.png
adb pull /sdcard/sc.png
3.打開sdk tools目錄下的uiautomatorviewer.bat,導入從機器獲取的截圖和資源文件