《Android uiautomatorviewer不能截图》

《Android uiautomatorviewer不能截图》

Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Permission denied

自家应用还老出问题。也是崩溃了。

在这里插入图片描述

uiautomator 提供对应命令可以dump界面信息。
编写对应脚本文件,执行就完事了。
再给该脚本起个命名,方便使用。

#!/bin/sh

builddate=`date '+%Y%m%d%H%M'`

adb shell uiautomator dump /sdcard/app.uix
adb pull /sdcard/app.uix ./app${builddate}.uix
#存到E盘的app.uix文件中,在E盘新建一个文本文档改成app.uix
adb shell screencap -p /sdcard/app.png
adb pull /sdcard/app.png ./app${builddate}.png

发布了170 篇原创文章 · 获赞 55 · 访问量 37万+

猜你喜欢

转载自blog.csdn.net/w695050167/article/details/86292189