Appium-超时,从未收到命令的响应

Appium-超时,从未收到命令的响应,appium,appium-android,Appium,Appium Android,Jenkins将使用Appium启动UI测试,但结果出现错误: 当Appium的任务正在运行时,找不到模拟器进程。 此外,Appium的输出显示: 好的,我看到设备没有启动,这就是超时错误的原因 但是为什么Appium不能启动它呢 我能够获得emulator可执行文件,Jenkin启动Appium任务的工作可以看到设备: 如果我只是通过运行以下命令手动启动设备: /android/Android/sdk/emulator/emulator -avd Nexus_5X_API_26 然后触发Je

Jenkins将使用Appium启动UI测试,但结果出现错误:

当Appium的任务正在运行时,找不到模拟器进程。 此外,Appium的输出显示:

好的,我看到设备没有启动,这就是超时错误的原因

但是为什么Appium不能启动它呢

我能够获得emulator可执行文件,Jenkin启动Appium任务的工作可以看到设备:

如果我只是通过运行以下命令手动启动设备:

/android/Android/sdk/emulator/emulator -avd Nexus_5X_API_26
然后触发Jenkin的工作-我还有一个错误:

有什么想法吗

甚至用appium搜索任何东西都不能从命令请求中得到响应

而且,我无法在我的工作站的笔记本电脑上重现这个问题——所有的工作都很完美

UPD属性为:

<profile>
    <id>linux-emulator-8.0</id>
    <properties>
        <hub.url>http://0.0.0.0:4723/wd/hub</hub.url>
        <device.name>Android Emulator</device.name>
        <avd>Nexus_5X_API_26</avd>
        <platform.name>Android</platform.name>
        <platform.version>8.0</platform.version>
        <auto.grant.permissions>true</auto.grant.permissions>
        <full.reset>true</full.reset>
        <no.reset>false</no.reset>
        <app.path>/home/user/project/project.apk</app.path>
        <app.name>com.gen.workoutme</app.name>
        <screenshot.path>
            ${project.basedir}/../screenShots/${platform.name}/${platform.version}/${device.name}/
        </screenshot.path>
        <automation.name>UiAutomator2</automation.name>
    </properties>
</profile>

由于某种原因,我还不能用谷歌搜索,但这看起来像是主要问题——尽管存在$DISPLAY连接。

我能够在emulator上启动并运行测试,没有任何问题。在设置驱动程序时,我使用以下三种功能以及其他功能

avd:avd的名称 avdLaunchTimeout:等待emulator启动的超时。 等待emulator准备就绪的超时。 尝试使用这些功能,你应该会很好


还要检查Android SDK和emulator是否有任何更新。如果有可用的更新,最好更新它。

您能展示您的能力吗?@olyv谢谢,添加了属性字段。是maven配置文件吗?您可以尝试添加avd功能。有关更多信息,请查看AndroidMobileCabilityTypeYup。你的意思不同吗?
[Pipeline] sh
+ avdmanager list avd
...
    Name: Nexus_5X_API_26
  Device: Nexus 5X (Google)
    Path: /home/user/.android/avd/Nexus_5X_API_26.avd
  Target: Google Play (Google Inc.)
          Based on: Android 8.0 (Oreo) Tag/ABI: google_apis_playstore/x86
    Skin: 1080x1920
  Sdcard: 100 MB
---------
    Name: test
    Path: /home/user/.android/avd/test.avd
  Target: Google APIs (Google Inc.)
          Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86
[Pipeline] sh
+ emulator -list-avds
Nexus_5X_API_26
test
/android/Android/sdk/emulator/emulator -avd Nexus_5X_API_26
...
[ADB] Using adb from /android/Android/sdk/platform-tools/adb
[debug] [ADB] Trying to find Nexus_5X_API_26 emulator
[debug] [ADB] Getting connected emulators
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] 1 emulator(s) connected
[debug] [ADB] Sending telnet command to device: avd name
[debug] [ADB] Getting running emulator port
[debug] [ADB] Socket connection to device created
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1542807589908 (15:39:49 GMT+0200 (EET))
[debug] [W3C] Encountered internal error running command: Error: Error getting AVD. Original error: Never got a response from command
[debug] [W3C]     at ADB.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:488:11)
...
<profile>
    <id>linux-emulator-8.0</id>
    <properties>
        <hub.url>http://0.0.0.0:4723/wd/hub</hub.url>
        <device.name>Android Emulator</device.name>
        <avd>Nexus_5X_API_26</avd>
        <platform.name>Android</platform.name>
        <platform.version>8.0</platform.version>
        <auto.grant.permissions>true</auto.grant.permissions>
        <full.reset>true</full.reset>
        <no.reset>false</no.reset>
        <app.path>/home/user/project/project.apk</app.path>
        <app.name>com.gen.workoutme</app.name>
        <screenshot.path>
            ${project.basedir}/../screenShots/${platform.name}/${platform.version}/${device.name}/
        </screenshot.path>
        <automation.name>UiAutomator2</automation.name>
    </properties>
</profile>
[ADB] [AVD OUTPUT] Fatal: QXcbConnection: Could not connect to display  ((null):0, (null))
[ADB] [AVD OUTPUT] INFO: QtLogger.cpp:66: Fatal: QXcbConnection: Could not connect to display  ((null):0, (null))
[ADB] Emulator avd Nexus_5X_API_26 exited with code null, signal SIGABRT