如何在不影响活跃用户的情况下测试您的应用程序?

huangapple go评论65阅读模式
英文:

How to test your app while not effecting active users?

问题

抱歉,由于您的要求,我只能提供翻译后的内容,不提供其他回答或解释。

我很快就准备在应用商店发布我的应用,但我想知道如何在不影响用户的情况下编辑/添加功能/更新我的应用。例如,如果我决定从服务器中添加或删除某些内容,我不希望整个应用在用户端崩溃。基本上是运行一个克隆,我可以随意尝试任何想做的事情,并且它与原始应用分开。我应该如何做到这一点?

如果我混淆了大家,而且我的英语不是最好的,真的很抱歉。

英文:

I am soon ready to release my app on the play store but I would like to know how can I edit/add features/update my app without affecting my users. For example if I decided to add or remove something from the server I don't want the whole app to crash on the users. Basically running a clone where I can try out anything I want and it stays separate from the original app. How do I do that?

I am really sorry if I confused you all and my English is not the best.

答案1

得分: 2

关于这一点,您将运行一个开发服务器并拥有应用的多个构建版本。

您可以使用Google Play将该应用程序分发给测试用户,具体步骤在此处有描述,或者您可以手动安装应用程序到测试设备。手动安装(如果您只有少数测试用户)比等待Google Play推送更新要快。

至于如何设置它,这将取决于您正在使用的工具以及您正在做什么。通常情况下,您会在Android中使用BuildConfig.java变量设置多个构建。您可以在那里检查构建类型并使用特定的API密钥/服务器URL,或者可以根据构建传递不同的值。更多信息请参见此处

基本上,在您的build.gradle文件中,您会有:

android {
    ...
    buildTypes {
        release {
            buildConfigField("String", "SERVER_URL", "https://api.example.com/")
        }
        debug {
            buildConfigField("String", "SERVER_URL", "https://api.dev.example.com")
        }
    }
}

您可以从“Build” > “Select Build Variant...”中切换要构建的变体,或者从Android Studio的侧边栏中切换。

现在您可以在代码中访问这些内容:

BuildConfig.SERVER_URL

接下来,您将把该应用程序分发给测试用户。

至于服务器端,这取决于您当前的设置以及您希望如何设置它。

英文:

For that you would run a development server and have multiple builds of your app.

You can use google play to distribute that app to your test users, described here or you can manually install the app on test devices. Manually installing is faster(if you have a few test users) than waiting for google play to push an update.

As for how to set it up, that would depend on what you are doing and with what tools. Usually you would set up multiple builds in android with BuildConfig.java variables. There you can either check the build type and use a specific API key/Server URL or you can pass a different value depending on the build. More info here.

Basically in your build.gradle you would have:

android {
    ...
    buildTypes {
        release {
            buildConfigField("String", "SERVER_URL", "https://api.example.com/")
        }
        debug {
            buildConfigField("String", "SERVER_URL", "https://api.dev.example.com")
        }
    }
}

You can switch which variant you are building from Build > Select Build Variant... or from the sidebar in Android Studio

Now you can access these from your code as:

BuildConfig.SERVER_URL

Next you would distribute that app to your test users.

As for the server side it depends on how you have it set up now and how you want to set it up.

答案2

得分: 2

Google Play的核心库(版本1.5.0或更高版本)为在运行于Android 5.0(API级别21)或更高版本设备以及Chrome OS设备上的应用提供了一个名为“In-app updates”的功能。如果您希望用户尝试新的应用功能或应用更新以提高性能或修复错误,Play Core库提供了两种方法。您可以使用灵活或即时的方式通知用户有可用更新。

“In-app updates”为您提供了一种新的请求流程,以提示活跃用户更新应用。使用灵活的方式,在仍在使用应用程序时会在后台下载并安装更新。使用即时选项时,用户必须接受更新请求,之后Google Play会管理安装并重新启动应用。

在Google Play开发者API中为每个更新设置优先级,这决定了您的应用如何推荐更新,使用介于0和5之间的整数值进行表示,默认为0,而5则是最高优先级。

英文:

Google Play’s Core library (on 1.5.0 or higher) has a feature for apps running on devices using Android 5.0 (API level 21) or higher and Chrome OS devices, called In-app updates. If you want users to try a new app feature or apply updates to improve performance or fix bugs, the Play Core library offers two methods. You can notify users about an available update using the Flexible or Immediate approach.

The In-app updates has a new request flow for you to prompt active users to update the app. Using the Flexible approach, the update is downloaded and installed in the background while the app is still in use. With the Immediate option, the user has to accept the update request after which Google Play manages the installation and restart the app.

Set a priority for each update in the Google Play Developer API, which determines how your app recommends an update, using an integer value between 0 and 5, with the default being 0 and 5 being the highest priority.

huangapple
  • 本文由 发表于 2020年7月24日 19:02:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/63072258.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定