使用Build Variants将应用从Beta推广到Google Play上的正式生产 [英] Promotion of app from beta to production on Google Play working with Build Variants

查看:120
本文介绍了使用Build Variants将应用从Beta推广到Google Play上的正式生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况

第1部分.一个使用Build Variants的应用程序:debugbetarelease如下

Part 1. An app working with Build Variants: debug, beta and release as follow

buildTypes {
    debug {
        versionNameSuffix '-DEBUG'
        applicationIdSuffix '.debug'
        buildConfigField "String", "SERVER_URL", '"url local test"'
        debuggable true
        signingConfig signingConfigs.config
    }
    beta {
        versionNameSuffix '-BETA'
        buildConfigField "String", "SERVER_URL", '"url homologation"'
        signingConfig signingConfigs.config
    }
    release {
        buildConfigField "String", "SERVER_URL", '"url production"'
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
}

然后调用以buildType selected指向当前URL的String SERVER_URL.看这个

And a call to use String SERVER_URL pointing to current url by buildType selected. Look this

String URL = BuildConfig.SERVER_URL

第2部分.在Android Studio的Build Variants之间切换,如下图所示

Part 2. The switch between Build Variants by Android Studio, as follow image

对我来说绝对不错

第1部分.我已经在Google Play制作中应用了该应用,是通过发行版本的签名APK生成的

Part 1. I have the app on Google Play production generated as signed apk from release variant

第2部分.我需要将该应用放在Google Play beta测试中,从BETA变体生成为签名的APK ,例如,指向url homologation

Part 2. I need put the app on Google Play beta test generating as signed apk from BETA variant, e.g, pointing to url homologation

第3部分.当产品所有者完成Beta测试后,我需要通过Google Play控制台将同一应用升级为正式版

Part 3. When the product owner finish the tests from beta test, I go need promote the same app to production by Google Play Console

核心问题:当我将应用程序从Beta推广到正式生产时,它会自动由release variant指向url production还是我需要生成另一个apk作为signed apk from release variant?

The core question: When I go promote the app from beta to production, it one will point automatically to url production by release variant or I will need generate another apk as signed apk from release variant?

为什么?主要动机是因为我不能在没有安全保证的情况下测试此促销活动,因为它可以正常工作,同样重要的是,这将节省我的时间,而我自己的厨师可以做到它

Why? The main motivation is beacause I can't test this promotion without safe assurance that it will work fine, and no less important, this would save my time and my own chef would can do it

警告!:如果这是错误的工作,那么最好的做法是什么?

Alert! If it is wrong job, what the best pratice to do it?

推荐答案

如果我理解您的问题,就是这样:

If I understand your question it is this:

  • 使用当前设置,您已经将一些配置编译到APK中,包括服务器URL
  • 您要在Beta中测试一台服务器,而在发行版中测试另一台服务器
  • 但这意味着您无法推广Beta版APK的发布,因为URL会有所不同.但是,如果您重新编译,则无法确定APK是否与您测试过的APK相同.

您是对的,这是一个真正的问题.有两种常见的解决方案:

You are right, this is a real problem. There are two common solutions:

  • 选项1:不要将服务器字符串编译到APK中.相反,请使用 Firebase远程配置之类的服务来动态更改服务器和其他设置为您的Beta.这样,APK无需更改
  • 选项2:构建Beta版本时,请在版本控制系统中标记分支.然后,当您要升级为正式版时,请构建一个新的APK,但请确保您使用的是版本控制系统中的带标签的分支.
  • Option 1: don't compile your server strings into your APK. Instead, use a service like Firebase remote config to dynamically change the server and other settings for your beta. That way the APK doesn't need to change
  • Option 2: When you build your beta build, tag your branch in your version control system. Then when you want to promote to prod, build a new APK, but make sure you are using the tagged branch from the version control system.

我个人认为我会推荐选项1,但我知道不同的大型专业android开发人员会同时使用这两个选项.

Personally I think I would recommend option 1, but I know different large professional android developers use both options.

这篇关于使用Build Variants将应用从Beta推广到Google Play上的正式生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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