Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to see the xml file after "adb shell uiautomator dump view.xml" [duplicate]

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?

like image 987
Leem.fin Avatar asked Aug 30 '16 09:08

Leem.fin


Video Answer


3 Answers

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
like image 124
akshaykadam_100 Avatar answered Oct 12 '22 01:10

akshaykadam_100


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
like image 35
Marian Paździoch Avatar answered Oct 12 '22 01:10

Marian Paździoch


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.

like image 34
Alex P. Avatar answered Oct 12 '22 02:10

Alex P.