Automatically accept all SDK licences

后端 未结 30 2131
感情败类
感情败类 2020-11-22 16:35

Since gradle android plugins 2.2-alpha4:

Gradle will attempt to download missing SDK packages that a project depends on

Which

30条回答
  •  余生分开走
    2020-11-22 17:34

    If you are using Jenkins, you can use the following bash script as first step in the build process:

    (while sleep 3; do echo "y"; done) | $ANDROID_HOME/tools/android update sdk -u
    

    This will of course install ALL available updates, but it will save you some time if you can spare the disk space. The sleep is to avoid the broken readline in the installation program, since "yes" does not work properly in this case.

    EDIT: You also need to add the "Install Android project prerequisites" plugin in the build step to get the correct $ANDROID_HOME if you are using the built in SDK manager.

提交回复
热议问题