Android的工作室:构建类型发布/调试 - 这是否有什么关联? [英] Android Studio: Build type release /debug - what relevance does this have?

查看:197
本文介绍了Android的工作室:构建类型发布/调试 - 这是否有什么关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建的android通过演播室APK它给了我创造我自己的键,我做了一个选项,但随后问我是什么类型的构建,即调试或释放。此外口味名单,其中不存在。

I just created an apk via android studio and it gave me an option of creating my own key, which i did but then asked me what type of build it is i.e. debug or release. Also list of flavours, which none exists.

这哪里是信息的设置,在文件的gradle?

Where is this information setup, in the gradle file ?

所以,如果我离开生成类型集中释放,这是否有什么关联。

So if I leave build type set to Release, what relevance does this have.

我有这个采购的任何文档的问题。

I am having problems sourcing any documentation on this.

任何想法?

推荐答案

调试和发布之间的差异建立是例如,你可以从调试版本日志输出而不是从发行版本。

The difference between debug and release builds is for example, that you can get the log output from the debug build but not from the release build.

调试版本可以使用默认密钥库签署的发布版本必须与您所创建的密钥库签署。

Debug builds can be signed with the default keystore, the release builds have to be signed with your created keystore.

您可以定义在应用程序的模块中的gradle buildTypes。这里有一个例子:

You can define the buildTypes in your App's module gradle. Here's an example:

    release {
        shrinkResources true
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    debug {
        applicationIdSuffix ".debug"
    }

您还可以定义不同的口味,像这样的:

Also you can define different flavors, like this:

productFlavors {
    pro {
        applicationId = "xx.xxx.xxx.pro"
        signingConfig signingConfigs.Pro
    }
    lite {
        applicationId = "xx.xxx.xxx.lite"
        signingConfig signingConfigs.Lite
    }
}

本系统可以更容易地创建从一个codeBase的不同的APK(免费或付费版本,等等。)

This system makes it easier to create different apks from one Codebase (free or paid version, etc.)

这篇关于Android的工作室:构建类型发布/调试 - 这是否有什么关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆