简体   繁体   English

Android Emulator插件无法在Jenkins中运行

[英]Android Emulator plugin not working in Jenkins

When I run test on Jenkins with option create emulator I have this problem: 当我使用选项创建模拟器在Jenkins上运行测试时,我遇到了这个问题:

[android] Could not create Android emulator: Failed to run AVD creation command [android]无法创建Android模拟器:无法运行AVD创建命令

When I target existing emulator I have this problem: 当我定位现有的模拟器时,我遇到了这个问题:

FATAL: C:\\Windows\\system32\\config\\systemprofile.android\\avd\\AVD_2.2.ini (The system cannot find the path specified) java.io.FileNotFoundException: C:\\Windows\\system32\\config\\systemprofile.android\\avd\\AVD_2.2.ini (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(Unknown Source) at java.io.FileReader.(Unknown Source) at hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436) at hudson.plugins.android_emulator.SdkInstaller$2.call(SdkInstaller.java:331) at hudson.plugins.android_emulator.SdkInstaller$2.call(SdkInstaller.java:328) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator(SdkInstaller.java:328) at hudson.plugins.android_emulator.SdkInstaller.getPlatformForEmulator(SdkInstaller.java:312) at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:174) at hudson.plugins.android_emulato 致命:C:\\ Windows \\ system32 \\ config \\ systemprofile.android \\ avd \\ AVD_2.2.ini(系统找不到指定的路径)java.io.FileNotFoundException:C:\\ Windows \\ system32 \\ config \\ systemprofile.android \\ avd \\ AVD_2.2.ini(系统找不到指定的路径)java.io.FileInputStream.open(本机方法)java.io.FileInputStream。(未知来源)java.io.FileReader。(未知来源) at hudson.plugins.andin_alulator.dols.Darses.darseConfig。(hs.pallgins.andol_meulator.SdkInstaller $ 2.call(sdkInstaller.java:331)at hudson.plugins.andol_emulator.SdkInstaller $ 2.call(SdkInstaller)的hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436) .java:328)位于hudson.plugins.docalChannel.call上的hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator(SdkInstaller.java:328)中的hudson.remoting.LocalChannel.call(LocalChannel.java:45)(SdkInstaller。) java:312)在hudson.plugins.android_emulato的hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:174) r.AndroidEmulator.setUp(AndroidEmulator.java:247) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1488) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) r.AndroidEmulator.setUp(AndroidEmulator.java:247)at hudson.model.Build $ BuildExecution.doRun(Build.java:154)at hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:499)at hudson.model .run.execute(Run.java:1488)位于hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)hudson.model.ResourceController.execute(ResourceController.java:88)hudson.model.Executor.run( Executor.java:236)

I have this file. 我有这个文件。 When I run manual emulator and tests on jenkins It works. 当我运行手动模拟器和jenkins测试它的工作原理。

The path shown in the second case suggests that you may be running Jenkins as a system service. 第二种情况中显示的路径表明您可能正在运行Jenkins作为系统服务。

In which case, you could try the workaround listed under "Known Issues" on the Android Emulator Plugin wiki page : 在这种情况下,您可以尝试Android Emulator Plugin wiki页面上“已知问题”下列出的解决方法:

Running in a Windows service as "Local System" 在Windows服务中作为“本地系统”运行
New AVDs cannot be generated and run if Jenkins is running as a Windows service, using the "Local System" account (see issue #7355 ). 如果Jenkins使用“本地系统”帐户作为Windows服务运行,则无法生成和运行新的AVD(请参阅问题#7355 )。

Workaround: configure the Jenkins service to "run as" a real user 解决方法:将Jenkins服务配置为“作为”真实用户运行


If that doesn't solve the problem, can you tell us in which directory AVDs are placed when you create them manually? 如果这不能解决问题,您可以告诉我们手动创建AVD时放置AVD的目录吗? You can find out by running emulator with the -verbose flag. 您可以通过使用-verbose标志运行emulator来查找。 Within the first few lines you should see something like: 在前几行中你应该看到类似的东西:

emulator: Android virtual device file at: c:\\users\\foo\\.android\\avd\\emu_4.0.3.ini 模拟器:Android虚拟设备文件位于:c:\\ users \\ foo \\ .android \\ avd \\ emu_4.0.3.ini

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM