Why the MonkeyRunner.waitForConnection() doesn't work in my environment?

蓝咒 提交于 2019-12-06 00:39:59
adb server is out of date. killing...

My guess is that you have more than one adb executable on your machine.

When you manually connect, you are using a version of adb that supports tcp

Monkeyrunner then uses a different version of adb, finds your existing server is out of date (which means either older OR newer) and kills it. It then starts a different version which doesn't know about your tcp connected device since you never told it (and it might not be a version that supports tcp).

This fails because there are no devices

Afterwards, you check, find the adb server out of date, kill it, start yours, and still find no devices...

try a find / -name "adb"

and then run adb version on each of them

Don't blindly delete either, rename it until you are sure you are using one that works.

The second parameter of waitForConnection is the device's serial number, in the case of the emulator is 'emulator-<port>':

device = MonkeyRunner.waitForConnection(5,'emulator-5554')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!