Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException

参考文章

https://blog.csdn.net/qq_38776582/article/details/105364683

https://blog.csdn.net/dengachao/article/details/100535536

费了很长时间一直解决不了ui automator viewer 分析控件的问题,原因说是ANDROID 8以上SDK的兼容性问题,最后还是按照上面这些参考文章提到的手动截图的方法处理的.

步骤:

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,导入从机器获取的截图和资源文件

 

posted on 2020-07-22 10:40  s1ihome  阅读(1173)  评论(0编辑  收藏  举报

导航