2014-09-11 98 views
0

我尝试从jenkins启动一个android模拟器。 我有如下编写一个批处理文件:从jenkins启动AVD

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

我执行从詹金斯此批处理文件。但它不启动模拟器。

我也试图从蟒蛇启动它,如下所示:

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

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

但后者给出了一个错误'PANIC: Could not open: AVD'。 当我在没有jenkins的情况下正常运行批处理文件时,一切正常。 我需要启动AVD,在其上安装apk,并通过jenkins运行一些自动化测试。请帮忙!!

+0

你在哪里保留了python脚本? – user3 2014-09-11 08:15:05

+0

python脚本通过批处理文件执行。 – 2014-09-11 09:32:51

+0

您是否使用主从设置?如果是的话,Master&Slave上的操作系统是什么? – Technext 2014-09-11 10:51:59

回答

0

它最终与jenkins的'Android Emulator Plugin'一起工作。

0

我觉得应该是权限问题。尝试以管理员身份运行jenkins客户端。

对于Python,您的通话子改变

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

我试图改变子进程调用。它仍然给出了同样的错误:通过jenkins运行时'PANIC:无法打开:AVD' – 2014-09-11 09:31:52

0

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

+0

它按照预期在命令行中工作。 – 2014-09-11 09:20:51