Gradle build and deploy specific buildtype

独自空忆成欢 提交于 2019-12-14 03:47:58

问题


I want to build my gradle project with a certain buildtype and deploy it on device with a single command.

My build.gradle is setup for multiple buildtypes such as live and release.

I worked with maven before and i look for an equivalent of:

mvn clean install -P release android:deploy android:run


回答1:


Here is the command to build and deploy through a specified BuildType. ( Thank you Varun! )

gradle installProfilename

Where Profilename of course would be the name of the BuildType specified in build.gradle

Example.:

gradle installRelease

Would build with the release profile:

buildTypes {

    release {
        debuggable false
        jniDebugBuild false
        signingConfig signingConfigs.main
        . . . 
    }

Addition.:

Gradle can show you what tasks are available.:

gradle tasks


来源:https://stackoverflow.com/questions/19294883/gradle-build-and-deploy-specific-buildtype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!