當前位置:編程學習大全網 - 網站源碼 - android8以後sdk自帶的uiautomator直接打開,截取不到機器界面信息

android8以後sdk自帶的uiautomator直接打開,截取不到機器界面信息

Error obtaining UI hierarchy(獲取UI層次結構時出錯)

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,導入從機器獲取的截圖和資源文件

  • 上一篇:華為nova8 pro升級鴻蒙哪個版本好
  • 下一篇:百川商戶平臺好不好
  • copyright 2024編程學習大全網