0

I've installed AndroidViewClient on Windows using easy_install as recommended, and I'm having trouble performing a basic dump.

D:\Apps\Python27\Lib\site-packages\androidviewclient-10.5.1-py2.7.egg\EGG-INFO\scripts>python dump -Vc
Connecting to a device with serialno=.* with a timeout of 60 secs...
Connected to device with serialno=.*
Actual device serialno=XXXXXXXXXX
Traceback (most recent call last):
  File "dump", line 189, in <module>
    vc.dump(window=options[WINDOW])
  File "D:\Apps\Python27\lib\site-packages\androidviewclient-10.5.1-py2.7.egg\com\dtmilano\android\viewclient.py", line 3074, in dump
    raise RuntimeError('''ERROR: UiAutomator output contains no valid information. UiAutomator was killed, no reason given.''' + extraInfo)
RuntimeError: ERROR: UiAutomator output contains no valid information. UiAutomator was killed, no reason given.

I just want to make sure that my AndroidViewClient install is sane, so that I can dig my way through transitioning from my current low-level UI calls with MonkeyRunner.

For the record, I'm using a Sony Xperia Z3 Compact (non-rooted).

Also, I have a very basic understanding or even no understanding at all for all this (python modules, android, AVC...), so I apologize right away and profusely for any obvious overlook...

dJe
  • 51
  • 5
  • Can you try `adb shell uiautomator dump`, check the resulting file and then run `dump` again to see if error persists? – Diego Torres Milano May 25 '15 at 04:25
  • Once I executed `adb shell uiautomator dump`, I couldn't find window_dump.xml at its default location (/storage/emulated/legacy/window_dump.xml) so I had to append it (I don't know if that's relevant or not). The file seems to be properly describing what's on my screen. However, `python dump -Vc` still returns the same error. – dJe May 25 '15 at 14:22
  • `uiautomator dump %s /dev/tty >/dev/null' % ('--compressed' if self.getSdkVersion() >= 18 and self.compressedDump else '')`; more or less, this is how dump is obtained (the %s is replaced by the option value or empty whether API >= 18). You can try with and without `--compressed` (from adb shell). – Diego Torres Milano May 25 '15 at 14:39
  • Both calls worked and wrote the expected XML files. `adb shell uiautomator dump` now properly writes window_dump.xml in its default location without requiring me any appended location. Unfortunately, `python dump -Vc` is still not cooperating. By the way, thanks a lot for taking the time to help me, it's very much appreciated. – dJe May 25 '15 at 15:18
  • `uiautomator dump /dev/tty` and `uiautomator dump --compressed /dev/tty` are the 2 commands you should test. Output should be in stdout, not in a file. – Diego Torres Milano May 25 '15 at 18:00
  • BTW, what is android API level? – Diego Torres Milano May 25 '15 at 18:00
  • I'm running Android 5.0.2 so I guess that it means the API level is 21. Both commands are properly sending their output to stdout... – dJe May 25 '15 at 19:33
  • Try enabling DEBUG_RECEIVIED in viewclient.py (`DEBUG_RECEIVED = DEBUG and False or True`), then `dump` will print what was received. – Diego Torres Milano May 25 '15 at 20:06
  • Yes, I'm properly getting the output. I've played around and noticed that removing "> /dev/null" from the call removes the "Killed\r\n" string that triggers the error. I may not get at all what is supposed to happen, but from where I stand it seems to me that it may be unexpected behavior. Anyway, I'm getting the information I need, so thank you **very much** for helping me out. Thanks a lot too for all the work you've done on AVC/culebra/adbclient/etc. :) – dJe May 26 '15 at 22:15
  • So, removing the "> /dev/null" fixes the problem? That's weird. Can you please send me the exact output when DEBUG_RECEIVED is enabled? – Diego Torres Milano May 26 '15 at 22:21
  • Both with DEBUG_RECEIVED enabled : [default output](http://pastebin.com/wRkEikJa), and [output received with '> /dev/null' removed from line #3059 in viewclient.py](http://pastebin.com/gExPT2rY). – dJe May 26 '15 at 22:41
  • Thanks a lot. I hope the reason for that can be found. I'll take a look. – Diego Torres Milano May 27 '15 at 02:12

0 Answers0