一、报错截图

android8以后sdk自带的uiautomator直接打开,截取不到机器界面信息。

建议可以使用以下方法手动截取
Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...
二、解决方法

1.截取uix文件

adb shell uiautomator dump /sdcard/sc.uix

adb pull /sdcard/sc.uix

注明:新手机地址改成:/data/local/tmp/**.uix

2.截取截图

adb shell screencap -p /sdcard/sc.png

adb pull /sdcard/sc.png

3.打开sdk tools目录下的uiautomatorviewer.bat,导入从机器获取的截图和资源文件

Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...
三、解决后截图
Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...

相关文章:

  • 2021-08-05
  • 2021-05-08
  • 2022-01-14
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2021-07-14
  • 2022-02-08
  • 2022-12-23
  • 2021-06-21
  • 2021-09-19
相关资源
相似解决方案