简体   繁体   English

如何使用Android Studio和/或Gradle仅构建单个buildType

[英]How to build only single buildType with Android Studio and/or Gradle

I've several build types in my build.gradle: 我在build.gradle中有几种构建类型:

signingConfigs {
  debug {
    storeFile file("debug.keystore")
    storePassword = "android"
    keyAlias = "androiddebugkey"
    keyPassword = "android"
  }
  unsigned{
    storePassword = ""
    keyAlias = ""
    keyPassword = ""
  }
  release {
    storeFile file("release.keystore")
    keyAlias "alias"
    storePassword "foo"
    keyPassword "bar"
  }
}

buildTypes {
  release {
    debuggable false
    jniDebugBuild false
    signingConfig signingConfigs.release
  }
  unsigned {
    debuggable false
    jniDebugBuild false
    signingConfig signingConfigs.unsigned
  }
  debug {
    debuggable true
    jniDebugBuild true
    signingConfig signingConfigs.debug
  }
}

which work fine but the problem is that I don't know (and I haven't find after lot of searching) a way how to build only single build type either from Android Studio or command-line. 哪个工作正常,但问题是我不知道(我没有找到很多搜索后)如何从Android Studio或命令行构建单一构建类型的方法。

Do you please know? 你知道吗?

Documentation says ( http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Android-tasks and http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Building-and-Tasks ) that you can use the following commands to produce specific build types: 文档说( http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Android-taskshttp://tools.android.com/tech-docs/new-build -system / user-guide#TOC-Building-and-Tasks )您可以使用以下命令生成特定的构建类型:

gradle assembleDebug
gradle assembleRelease

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 gradle:Android Studio继承buildtype - gradle: Android Studio inherit buildtype Gradle:Android Studio BuildType 资源继承 - Gradle: Android Studio BuildType Resource Inheritance 如何尽早在 build.gradle 中获取构建类型 - How to get the buildtype in a build.gradle EARLY ON 如何在 build.gradle 的 buildType 中获得风味? - How to get flavor in buildType of build.gradle? 如何在 Android Gradle 配置中获取当前的 buildType - How to get current buildType in Android Gradle configuration 在Android / Gradle中如何定义仅在构建特定buildType / buildVariant / productFlavor时运行的任务(v0.10 +) - In Android/Gradle how to define a task that only runs when building specific buildType/buildVariant/productFlavor (v0.10+) Android:仅在 Gradle 中的 Release BuildType 上自动递增版本代码 - Android: Auto Increment version code only on Release BuildType in Gradle Gradle构建和部署特定的构建类型 - Gradle build and deploy specific buildtype Gradle:如何具有“模拟” buildType取决于另一个android库项目的“模拟” buildType? - Gradle: How to have a 'mock' buildType depend on a 'mock' buildType of another android library project? 我们如何根据gradle中的buildType在Android应用程序中强制设置语言环境 - how can we force locale in android app depending on buildType in gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM