简体   繁体   English

从詹金斯启动AVD

[英]Start AVD from jenkins

I am try to launch an android emulator from jenkins. 我尝试从jenkins启动一个Android模拟器。 I have written a batch file as follows: 我写了一个批处理文件,如下所示:

cd E:\android-sdk\tools
emulator.exe -avd "AVD" -wipe-data

I execute this batch file from jenkins. 我从詹金斯执行此批处理文件。 But it does not launch the emulator. 但是它不会启动模拟器。

I have also tried launching it from python as follows: 我也尝试过从python启动它,如下所示:

bash = "E:\\android-sdk\\tools\\emulator"
print "executing: " + bash

f_handle = open('test_output_launch.txt','w+')
process = subprocess.Popen([bash, '-avd', 'AVD'])

But the latter gives an error 'PANIC: Could not open: AVD' . 但是后者给出了错误'PANIC: Could not open: AVD' Where as when I run the batch file normally without jenkins, everything works perfectly. 就像我在没有jenkins的情况下正常运行批处理文件时一样,一切正常。 I need to launch the AVD, install apk on it, and run some automated tests via jenkins. 我需要启动AVD,在其上安装apk,然后通过jenkins运行一些自动化测试。 Please help!! 请帮忙!!

I think, it should be permission issue. 我认为应该是许可问题。 Try running the jenkins client as admin. 尝试以管理员身份运行jenkins客户端。

For Python, change your subprocess call to 对于Python,请将您的子流程调用更改为

process = subprocess.Popen(['emulator.exe', '-avd', 'AVD'], cwd=bash)

您可以先在命令行中尝试脚本。

最终,它与jenkins的“ Android模拟器插件”一起使用。

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

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