Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT…
Android8.0以上,打开Uiautomatorviewer报错,可以通过以下四步来解决
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.打开uiautomatorviewer,导入sc.uix文件与sc.png文件
解决后截图:
感谢:https://blog.csdn.net/dengachao/article/details/100535536