0

I finally managed to successfully build a Nexus 10 image (full_manta-userdebug) with Google Mobile Services installed but unfortunately, I'm unable to use my MonkeyRunner script that uses AndroidViewClient. It crashes out of the script with the following:

/system/bin/sh: uiautomator: not found


130628 14:12:41.242:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
130628 14:12:41.242:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call last):
  File "/home/allen/projects/cts-scripts/4.2/cts-setup.py", line 361, in <module>
    main()
  File "/home/allen/projects/cts-scripts/4.2/cts-setup.py", line 339, in main
    vc = ViewClient(device, serialno)
  File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1188, in __init__
    self.dump()
  File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1780, in dump
    self.setViewsFromUiAutomatorDump(received)
  File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1530, in setViewsFromUiAutomatorDump
    self.__parseTreeFromUiAutomatorDump(received)
  File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1688, in _ViewClient__parseTreeFromUiAutomatorDump
    self.root = parser.Parse(receivedXml)
  File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 988, in Parse
    parserStatus = parser.Parse(uiautomatorxml, 1)
  File "/home/allen/android/android-sdks/tools/lib/jython-standalone-2.5.4-rc1.jar/Lib/xml/parsers/expat.py", line 212, in Parse
xml.parsers.expat.ExpatError: Content is not allowed in prolog.

Do I need to install the ViewServer for this to work or did I forget to include the uiautomator backend when I built the image?

Android Noob
  • 3,271
  • 4
  • 34
  • 60

1 Answers1

1

Try uiautomator from command line to find out if it's there or not:

$ adb shell uiautomator

if your output is similar to

Usage: uiautomator <subcommand> [options]

Available subcommands:

help: displays help message
...

then you have uiautomator installed. Otherwise if the output is

/system/bin/sh: uiautomator: not found

then you forgot to include it in the image.

You don't need ViewServer if UiAutomator is used as AndroidViewClient back-end.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • Ok, thanks. I actually got the second response from the shell. How do i include it in the image? When I checked the frameworks/testing/ folder, there was a folder for uiautomator so it looks like it was there. But what doesn't make sense is why it wasn't enabled. – Android Noob Jun 29 '13 at 04:02
  • It turns out that the build i got from my company's servers was no good. I synced with the AOSP Jellybean build from the Google website and uiautomator was there. – Android Noob Jul 05 '13 at 21:41