16

I've several build types in my 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.

Do you please know?

4

1 回答 1

19

文档说(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
于 2013-10-28T12:32:45.217 回答