This question already has answers here:
Is there a way to get current activity's layout and views via adb?

(6个答案)


3年前关闭。




我用命令
adb shell uiautomator dump view.xml

转储当前Android屏幕的UI层次结构。然后,我尝试查看 view.xml ,我尝试了以下命令:
adb shell cat view.xml

但出现错误:
/system/bin/sh: cat: view.xml: No such file or directory

如何/在哪里可以看到转储的view.xml文件?

最佳答案

您为什么不执行以下操作:

adb shell uiautomator dump

adb pull /sdcard/window_dump.xml

如果您直接想从shell中读取信息,则可以在转储XML之后从adb shell执行以下命令
adb shell cat /sdcard/window_dump.xml

关于android - "adb shell uiautomator dump view.xml"之后在哪里可以看到xml文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39223464/

10-11 22:32
查看更多