一汁咏、報(bào)錯(cuò)信息
Error obtaining UI hierarchy(獲取UI層次結(jié)構(gòu)時(shí)出錯(cuò))
Reason:(原因:)
????Unexpected error while obtaining UI hierarchy(獲取UI層次結(jié)構(gòu)時(shí)出現(xiàn)意外錯(cuò)誤)
Details:(細(xì)節(jié):)
????java.lang.reflect.InvocationTargetException(調(diào)用目標(biāo)異常)
照顧像我一樣英語不好的小盆友
二很魂、原因
本人是安卓9.0的系統(tǒng),因?yàn)閡iautomatorview 不兼容安卓8.0以上版本所以報(bào)錯(cuò)馒闷,8.0以下可以正常使用。
三叁征、解決辦法
1纳账,使用手機(jī)模擬器
2,用8.0以下的安卓手機(jī)
3航揉,手動(dòng)截取
??? 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塞祈,導(dǎo)入從機(jī)器獲取的截圖和資源文件