我正在尝试使用jenkins构建我的android工作室项目,我遇到了错误adb not found,我正在使用gradle模拟器插件。
java.io.IOException: Cannot run program "/var/lib/jenkins/tools/android-sdk/platform-tools/adb": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.plugins.android_emulator.AndroidEmulator.doSetUp(AndroidEmulator.java:304)
at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:263)
at hudson.model.Build$BuildExecution.doRun(Build.java:154)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 12 more
完成:失败
$ /var/lib/jenkins/tools/android-sdk/tools/android list target
[android] Using Android SDK: /var/lib/jenkins/tools/android-sdk
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb start-server
似乎jenkins正在使用android sdk文件夹,所以我不认为它与路径相关的问题
在本地机器中我之前遇到过同样的错误(解决方案是安装一系列库)
sudo apt-get install ia32-libs
但我不确定如何在詹金斯做到这一点..
任何想法? 感谢
答案 0 :(得分:4)
你应该在jenkins中配置ANDROID_HOME
答案 1 :(得分:0)
您需要在构建步骤的adb path
中的Jenkins中指定execute shell
。
export Path = "which ever your path is"
您可以使用which adb