700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 【学习笔记】【MAC】uiautomatorviewer定位华为P30手机报错Unexpected error while obtaining UI hierarchy

【学习笔记】【MAC】uiautomatorviewer定位华为P30手机报错Unexpected error while obtaining UI hierarchy

时间:2024-07-17 06:25:09

相关推荐

【学习笔记】【MAC】uiautomatorviewer定位华为P30手机报错Unexpected error while obtaining UI hierarchy

报错信息

Unexpected error while obtaining UI hierarchy

details:

Unexpected error while obtaining UI hierarchy

java.lang.reflect.InvocationTargetException

问题原因

android8.1以后sdk tools自带的uiautomator直接打开,截取不到设备界面信息

解决方案

1.截取设备界面资源

(1)截取uix资源文件

adb -s GBGDU19924002753 shell uiautomator dump /sdcard/screen.uix

adb -s GBGDU19924002753 pull /sdcard/screen.uix .

(2)截取界面截图

adb -s GBGDU19924002753 shell screencap -p /sdcard/screen.png

adb -s GBGDU19924002753 pull /sdcard/screen.png .

2.启动sdk uiautomatorviewer,具体命令如下

cd sdk/tools

./uiautomatorviewer

点击Open

3.导入步骤1获取的界面资源,即可正常定位华为P30元素信息

参考:/copyworker/p/11043705.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。