提问者:小点点

Android Emulator插件无法在Jenkins中工作


当我使用选项创建模拟器在Jenkins上运行测试时,我遇到了这个问题:

[android]无法创建Android模拟器:无法运行AVD创建命令

当我以现有仿真器为目标时,我遇到了以下问题:

致命错误:C:\Windows\system32\config\systemprofile.android\avd\avd_2.2.ini(系统找不到指定的路径)java.io.FileNotFoundException:C:\Windows\system32\config\systemprofiles.android\avd\avd_20.2.ini(在java.io.File InputStream.open(本机方法)(位于java.io.FFileInputStream.(未知源)(位于hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436),位于hudson.plugins.andrid_emulator.SdkInstaller$2.call(SdkInstaller.java:331),位于hudson.plugins.android-emulator.SdkInstaller$2.call(SdkInstaller.java:328),位于:hudson.remoting.LocalChannel.call(LocalChannel.java:45),位于hudson.plugins.android_emulator.SdkInstaller.getPlatformForEmulator(SdkInstaller.java:312)位于hudson.plugins.andrid_emulator.SdkInstaller.installDependencies(AbstractBuild.java:499)位于hudson.model.Run.execute(Run.java:1488)位于hudson.model.FreeStyleBuild.Run(FreeStyleBuild.java:46)位于huds on.model.ResourceController.execute(ResourceController.java:88)位于hudson.model.Executor.Run(Executor.java:236)

我有这个文件。当我运行手动模拟器并在 jenkins 上进行测试时,它可以工作。


共1个答案

匿名用户

第二种情况下显示的路径表明您可能正在将Jenkins作为系统服务运行。

在这种情况下,您可以尝试Android模拟器插件wiki页面上“已知问题”下列出的解决方法:

在Windows服务中作为“本地系统”运行
如果Jenkins作为Windows服务运行,则无法使用“本地系统(Local System)”帐户生成并运行新的AVD(请参阅问题#7355)。

解决方法:将Jenkins服务配置为以真实用户的身份运行

如果这不能解决问题,您能告诉我们手动创建 AVD 时放置在哪个目录中吗?您可以通过运行带有 -verbose 标志的模拟器来查找。在前几行中,您应该看到类似以下内容:

仿真器:位于c:\users\foo\.Android\avd\emu4.0.3.ini的Android虚拟设备文件