1

I'm using Jenkins for continous integration on an android emulator to run instrumentation tests with the espresso framework. Unfortunately the server is not able to connect to the emulator. I have a master instance which delegates the push events from GitHub to the slave instance where the android sdk is installed. I installed the android-emulator-plugin and configured it like described. At first the Jenkins starts the emulator, but it cannot connect to it afterwards. This is the result:

enter image description here

I also cannot connect to the emulator when I'm on the slave machine. But if I use 127.0.0.1 instead of localhost the adb tool can connect to the emulator:

enter image description here

Is it possible to use 127.0.0.1 instead of localhost with the android-emulator-plugin? I already specified the enviorment variables $ANDROID_AVD_DEVICE and $ANDROID_SERIAL with no result. Any ideas?

4

2 回答 2

1

我整天都在和它战斗。只需尝试在 /etc/hosts 中评论 ipv6。

于 2016-04-04T19:11:40.160 回答
0

我自己解决了这个问题。我在 GitHub 上查看了一个 fork,它使用 127.0.0.1 而不是 localhost。这确实适用于连接到模拟器,但不适用于运行仪器测试。我不再使用 Jenkins 插件进行连接。我使用包含启动 AVD 和 gradle 任务的所有命令的 shell 脚本进行构建。对我来说很好。但是谢谢你的建议。如果我有时间在 Jenkins 上工作,也许我也会尝试评论 ipv6。

于 2016-04-06T12:24:31.750 回答