我正在尝试为Jenkins配置android emulator plugin,而我'm having a hard time trying to figure out why the plugin can't找到Android SDK .
首先,克隆项目后Jenkins总是输出:
[android] No Android SDK found; let's install it automatically...
[android] Going to install required Android SDK components...
[android] Installing the 'platform-tool,tool' SDK component(s)...
$ /var/lib/jenkins/tools/android-sdk/tools/android update sdk -u -a -t platform-tool,tool
之后,它失败了,因为插件可能不知道如何回答许可协议 .
Do you accept the license 'android-sdk-license-bcbbd656' [y/n]:
Unknown response ''.
Do you accept the license 'android-sdk-license-bcbbd656' [y/n]:
Unknown response ''.
Max number of retries exceeded. Rejecting 'android-sdk-license-bcbbd656'
所以我只是复制命令我自己并安装了所有的东西 . 输出保持不变,未找到Android SDK . 我试图chown和chmod 755文件夹,以确保Jenkins可以访问它,并再次失败 .
我检查了Jenkins配置,我可以明确地告诉Jenkins android SDK在哪里,但知道它失败并出现另一个错误:我用 /var/lib/jenkins/tools/android-sdk/ 填充了字段 Android SDK root ,但它显示了 Required tools not found (adb etc.) .
这是 ls -la at /var/lib/jenkins/tools/android-sdk
drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:12 .
drwxr-xr-x 5 jenkins jenkins 4096 May 15 20:20 ..
-rwxr-xr-x 1 jenkins jenkins 6 May 16 12:36 .jenkins-install-info
-rwxr-xr-x 1 jenkins jenkins 0 Dec 20 20:00 .timestamp
-rwxr-xr-x 1 jenkins jenkins 1158 Dec 6 16:50 SDK Readme.txt
drwxr-xr-x 2 jenkins jenkins 4096 May 15 19:45 add-ons
drwxr-xr-x 3 jenkins jenkins 4096 May 16 09:02 build-tools
drwxr-xr-x 19 jenkins jenkins 4096 May 16 09:49 docs
drwxr-xr-x 3 jenkins jenkins 4096 May 16 11:12 platform-tools
drwxr-xr-x 8 jenkins jenkins 4096 May 16 10:43 platforms
drwxr-xr-x 2 jenkins jenkins 4096 May 16 11:12 temp
drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:11 tools
这是 ls -la 在 /var/lib/jenkins/tools/android-sdk/platform-tools
drwxr-xr-x 3 jenkins jenkins 4096 May 16 11:12 .
drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:12 ..
-rwxr-xr-x 1 jenkins jenkins 467531 May 16 11:12 NOTICE.txt
-rwxr-xr-x 1 jenkins jenkins 1226659 May 16 11:12 adb
drwxr-xr-x 2 jenkins jenkins 4096 May 16 11:12 api
-rwxr-xr-x 1 jenkins jenkins 176550 May 16 11:12 fastboot
-rwxr-xr-x 1 jenkins jenkins 16644 May 16 11:12 source.properties
这清楚地表明adb在那里并按照上面的命令运行:
sudo -u jenkins ./adb version
Android Debug Bridge version 1.0.31
任何有关此问题的帮助将非常感激 .