在ubuntu环境开发,没找到UI Automator Viewer
想到UI Automator Viewer支持导入 xml资源 和 截图
同时该方法也适用于 即时获取设备截图时报错的情况
dump资源文件 再导出到本地
adb shell uiautomator dump /data/local/tmp/app.uix
adb pull /data/local/tmp/app.uix /home/xd/geather/app.uix
获取截图 导出
adb shell screencap -p /data/local/tmp/app.png
adb pull /data/local/tmp/app.png /home/xd/geather/app.png
传到Window里,有了截图文件和资源文件,点击UI Automator Viewer菜单栏第一个图标即可导入解析,分析UI