0

I am trying to run monkeyrunner on my Raspberry Pi but having difficulty.

First I installed the Android Tools adb package ....

apt-get clean
apt-get update
apt-get upgrade
apt-get install android-tools-adb

.... which proceeded smoothly and completed with no apparent gotchas.

When I just run "adb devices" from the command line, it looks fine:

root@raspberrypi:~# adb devices
List of devices attached 
LGL41Cda259c3   device

root@raspberrypi:~#

so it seems the underlying USB plumbing between RPi and my phone, USB debugging mode, etc. is all working properly. Also I can run "adb shell", etc. with no trouble.

I downloaded the Android Studio command line tools .tgz from the official website onto the RPi, unzipped and extracted the directory structure+files from the tar archive into my /home/pi directory, etc. That went well.

However, when I run monkeyrunner (as root), I immediately get the error ---

root@raspberrypi:~# /home/pi/android-sdk-linux/tools/monkeyrunner
E/adb: Cannot run program "/home/pi/android-sdk-linux/tools/adb": error=2, No such file or directory

So, I thought ... this should be easy --- just put a copy of /usr/bin/adb in /home/pi/android-sdk-linux/tools and all will be fine.

Now when I run monkeyrunner (as root), it does this ---

root@raspberrypi:~# /home/pi/android-sdk-linux/tools/monkeyrunner
01:01:40 E/DeviceMonitor: Connection attempts: 1
01:01:41 E/DeviceMonitor: Connection attempts: 2
01:01:42 E/DeviceMonitor: Connection attempts: 3
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35) 
[Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.8.0_65
01:01:43 E/DeviceMonitor: Connection attempts: 4
>>> 01:01:44 E/DeviceMonitor: Connection attempts: 5
01:01:45 E/DeviceMonitor: Connection attempts: 6
01:01:46 E/DeviceMonitor: Connection attempts: 7
01:01:47 E/DeviceMonitor: Connection attempts: 8
01:01:48 E/DeviceMonitor: Connection attempts: 9
01:01:49 E/DeviceMonitor: Connection attempts: 10
[ad infinitum]

I've tried to do my research on this, and have found some seemingly relevant references with 'fixes' which basically seem to focus on config options to discourage IPv6 binding and forcing IPv4 binding, stopping and restarting the adb-server, etc. but nothing (including those) has helped.

I would greatly appreciate any further suggestions, since I would really like to get this to work using my RPi instead of my Windows laptop. Thank you very much.

user2790
  • 1
  • 1
  • the `monkeyrunner` script seems to have a few dependencies - start with `SWT` http://stackoverflow.com/questions/23321092/trying-to-run-an-swt-based-gui-on-raspberry-pi – Alex P. Aug 20 '16 at 20:08
  • Try [AndroidViewClient/culebra](https://github.com/dtmilano/AndroidViewClient) which requires only python 2.x – Diego Torres Milano Aug 22 '16 at 16:19
  • Thank you very much Alex & Diego. I did try to dig into this further per Alex's suggestion but couldn't really find anything significant with respect to my problem. All I can figure out is that there is something peculiar about how monkeyrunner invokes the adb functionality it needs which is different than when I do it directly from the command line. However, exactly what that may be seems to be hidden inside its jar file. Diego's suggestion to use culebra looks very promising, and I think that is what I am going to pursue. Once again, many thanks. Your help is greatly appreciated. – user2790 Aug 27 '16 at 14:50

0 Answers0