6

I use command

adb shell uiautomator dump view.xml

to dump the UI hierarchy of current Android screen. Then, I try to see the view.xml, I tried command:

adb shell cat view.xml

but get error:

/system/bin/sh: cat: view.xml: No such file or directory

How/Where can I see the dumped view.xml file?

Leem.fin
  • 40,781
  • 83
  • 202
  • 354

3 Answers3

3

Why don't you do the following:

adb shell uiautomator dump  

adb pull /sdcard/window_dump.xml   

If you directly want to read out from shell you can execute following command from adb shell after dumping the XML

adb shell cat /sdcard/window_dump.xml
Akshay Kadam
  • 502
  • 4
  • 8
2

Being on your developer machine you can dump the "UI hierarchy of current Android screen" to /sdcard/window_dump.xml on the smartphone with command:

adb shell uiautomator dump

the response is:

UI hierchary dumped to: /sdcard/window_dump.xml

then you can cat the xml to your developer machine's filesystem with command:

adb shell cat /sdcard/window_dump.xml > ~/duuuuuuuuuuuump.xml

the you can view it with favorite xml viewer, for example nano:

nano ~/duuuuuuuuuuuump1.xml
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
1

Either use absolute path or just use adb shell uiautomator dump without filename parameter at all - it will use the default location. In your case you are trying to create the /view.xml file and you have no writing permission for the / folder.

Alex P.
  • 30,437
  • 17
  • 118
  • 169