When connecting monkeyrunner to a device via TCP, it throws up the
"Adb rejected adb port forwarding command: unknown host service"
error.  I can successfully talk to the device using just adb (adb
shell, install, push, pull etc.)

Is there something that I am forgetting to set ?
Should I start ADB before running monkeyrunner scripts ?

Steps to reproduce:

>adb kill-server
>adb connect xxx.xxx.xxx.xxx
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to xxx.xxx.xxx.xxx:5555

>adb devices
List of devices attached
xxx.xxx.xxx.xxx:5555       device


>c:\android-sdk\tools\monkeyrunner.bat

Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26)
[Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0
>>> from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
>>> dev = MonkeyRunner.waitForConnection(20,"xxx.xxx.xxx.xxx:5555")
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port
forwarding command: unknown host service
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.AdbCommandRejectedException:
unknown host service
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.ddmlib.AdbHelper.createForward(AdbHelper.java:537)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.ddmlib.Device.createForward(Device.java:300)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.adb.AdbMonkeyDevice.createManager(AdbMonkeyDevice.java:
118)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.adb.AdbMonkeyDevice.<init>(AdbMonkeyDevice.java:
66)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.adb.AdbBackend.waitForConnection(AdbBackend.java:
100)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:
78)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
java.lang.reflect.Method.invoke(Unknown Source)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:
175)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:
190)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyObject.__call__(PyObject.java:414)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyObject.__call__(PyObject.java:418)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.pycode._pyx6.f$0(<stdin>:1)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.pycode._pyx6.call_function(<stdin>)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyTableCode.call(PyTableCode.java:165)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.PyCode.call(PyCode.java:18)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.Py.runCode(Py.java:1197)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.core.Py.exec(Py.java:1241)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.PythonInterpreter.exec(PythonInterpreter.java:147)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:
89)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:
70)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:
46)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveConsole.push(InteractiveConsole.java:110)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveConsole.interact(InteractiveConsole.java:
90)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
org.python.util.InteractiveConsole.interact(InteractiveConsole.java:
60)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.ScriptRunner.console(ScriptRunner.java:193)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:
90)
111018 13:42:18.308:S [main]
[com.android.monkeyrunner.adb.AdbMonkeyDevice]     at
com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:
203)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
        at
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:
182)
        at
com.android.monkeyrunner.adb.AdbMonkeyDevice.<init>(AdbMonkeyDevice.java:
68)
        at
com.android.monkeyrunner.adb.AdbBackend.waitForConnection(AdbBackend.java:
100)
        at
com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:
78)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
        at java.lang.reflect.Method.invoke(Unknown Source)

java.lang.NullPointerException: java.lang.NullPointerException
>>>


I also tried :


>>> dev = MonkeyRunner.waitForConnection(20,"xxx.xxx.xxx.xxx")
>>> dev.takeSnapshot()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
        at
com.android.monkeyrunner.MonkeyDevice.takeSnapshot(MonkeyDevice.java:
83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
        at java.lang.reflect.Method.invoke(Unknown Source)

java.lang.NullPointerException: java.lang.NullPointerException


I would really appreciate any help.
Jakub

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to