本文介绍了摇篮构建和部署具体buildtype的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一定buildtype打造的gradle我的项目,并在设备上使用一个命令部署它。

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

我的build.gradle是设置多个buildtypes如现场和释放。

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

我与Maven的工作前,我寻找的等效:

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

MVN清洁安装-P发布Android:Android的部署:运行

推荐答案

下面是建立和通过指定BuildType部署命令。 (谢谢Varun的!)

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

gradle installProfilename

其中的配置文件名称当然将是的build.gradle指定的BuildType的名称

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
        . . .
    }

增加:

摇篮可以告诉你什么任务:

Gradle can show you what tasks are available.:

gradle tasks

这篇关于摇篮构建和部署具体buildtype的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:53