【Uiautomatorviewer】报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...

android 9.0系统不能用uiautomator识别html

解决方法:android 8.0 之后 uiautomator 没法直接使用的问题http://www.javashuo.com/article/p-xfftpmvf-dx.htmlandroid

android8.1之后sdk tools自带的uiautomator直接打开,截取不到机器界面信息。shell

可使用如下方法手动截取。post

首先操做机器定位到要分析的界面。ui

1.截取uix资源文件url

adb shell uiautomator dump /sdcard/screen.uixspa

adb pull /sdcard/screen.uix D:/screen.uixcode

注明:新手机地址改为:/data/local/tmp/**.uixhtm

2.截取截图blog

adb shell screencap -p /sdcard/screen.png

adb pull /sdcard/screen.png D:/screen.png

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

相关文章
相关标签/搜索