适用于 Jenkins 管道的 Android 模拟器

bre*_*ham 6 android android-emulator jenkins jenkins-pipeline

寻找将在管道作业中模拟 Android 的 Jenkins 插件。

此插件在Freestyle 作业运行良好,但目前不支持管道

有没有其他方法可以通过 Jenkins 管道在 Android 上运行功能测试?

Pav*_*rin 2

您可以使用以下 shell 脚本运行模拟器:

sh '${ANDROID_HOME}/emulator -avd <avd_name> [<options>]'
Run Code Online (Sandbox Code Playgroud)

在此之前,您应该创建一个avdonce:

~/.android/android create avd ...
Run Code Online (Sandbox Code Playgroud)

或者使用 UI 来实现。

您可以在这里找到更多信息

这里还有一个针对 Jenkins 问题的建议:

step([
        $class: 'AndroidEmulator',
        osVersion: 'android-23',
        screenResolution: '1080x1920',
        screenDensity: 'xxhdpi',
        deviceLocale: 'en_US',
        targetAbi: 'x86',
        sdCardSize: '200M',
        showWindow: true,
        commandLineOptions: '-noaudio -gpu mesa -qemu -m 1024 -enable-kvm'
])
Run Code Online (Sandbox Code Playgroud)

你尝试过吗?

  • Jenkins 问题中的“step”示例是一种建议的实例化类的方法;这实际上尚未实施。 (3认同)