Now, i'm studying how to use the MonkeyRunner to test android devices in the win7, now i have downloaded the latest android sdk, and configured all of the env
There is an android4.4.2 tv set that enabled adbd, no usb debug port, but network is available. I can use a following commend to connect this device with adb in my pc:
adb connect 172.30.198.240.
Then i saw following print in my command window:
List of devices attached
172.30.198.240:5555 device
Checked this connection that was successful. we can use "adb shell" command to login the tv system shell.
i wrote a python script(called test.py) to test the MonkeyRunner.
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection() # <---can't connect device
if device is not None:
device.takeSnapshot()
after aboves done, i input the "monkeyrunner.bat test.py" in the win7 command window.
the codes blocked at the MonkeyRunner.waitForConnection() for ever, and adb server was killed.
I have tried many ways, but all of them were failed.
Try1:
input monkeyrunner.bat -s 172.30.198.240 test.py, but failed again.
Try2:
i googled this issue, someone said we must set the adb port to 12345, so, i changed the adb default port from 5555 to 12345 by using adb tcpip 12345,
failed again.
Try3:modify the script, add parameters for the waitForConnection method
device = MonkeyRunner.waitForConnection(5, "172.30.198.240:5555")
i got a nullpointer error for the device.
But if i use a phone with a usb debug port to connect my pc, above script ran ok.
I don't know why, could you help me?
thanks a lot