我写了一个bash脚本,我的Android项目将在其中构建。我可以成功安装gradle
和sdk
工具。我用gradle wrapper
创建 Package 器。但是当我想使用./gradlew assembleDebug -x lint
获得调试apk时,需要很长时间才能下载模拟器:
Checking the license for package SDK Patch Applier v4 in /build/sdk/licenses
License for package SDK Patch Applier v4 accepted.
Preparing "Install SDK Patch Applier v4 (revision: 1)".
"Install SDK Patch Applier v4 (revision: 1)" ready.
Installing SDK Patch Applier v4 in /build/sdk/patcher/v4
"Install SDK Patch Applier v4 (revision: 1)" complete.
"Install SDK Patch Applier v4 (revision: 1)" finished.
Checking the license for package Android Emulator in /build/sdk/licenses
License for package Android Emulator accepted.
Preparing "Install Android Emulator (revision: 32.1.12)".
字符串
我还使用-d
运行了该命令,并找到了模拟器版本。接下来,我下载了模拟器zip并将其解压缩到正确的目录。但是当我再次运行assembleDebug
时,我得到了以下警告:
Package "com.android.repository.impl.generated.v2.RemotePackage@86464c36" (emulator) should be installed in "/usr/lib/sdk/emulator" but it already exists. Installing in "/usr/lib/sdk/emulator-2" instead.
型
我想跳过下载模拟器(如果它可用)或将zip文件传递给它,以防止停留在此状态。
1条答案
按热度按时间j13ufse21#
通过在gradle.properties中设置标志,可以禁用Gradle Package 器自动SDK下载:
要手动禁用此功能,请在项目的gradle.properties文件中设置android.builder.sdkDownload=false。
https://developer.android.com/studio/intro/update#download-with-gradle