简体   繁体   English

确定Google Play环境(制作,测试版,alpha版)

[英]Determine environment Google Play (production, beta, alpha)

Is it possible for the app to determine in what environment of Google Play the app is released? 应用是否可以确定应用发布在Google Play的哪个环境中?

I want to know if the app is located in the alpha, beta or production channel so i can use different API urls for each of the environments, like so: 我想知道应用程序是否位于alpha,beta或生产渠道中,因此我可以为每个环境使用不同的API网址,如下所示:

  • alpha - test.example.com/api/login alpha - test.example.com/api/login

  • beta - staging.example.com/api/login beta - staging.example.com/api/login

  • production - example.com/api/login 生产 - example.com/api/login

Right now i have to upload many different APK's and increment the versionCode to use the 3 different channels. 现在我必须上传许多不同的APK并增加versionCode以使用3个不同的频道。 So is it possible to determine the channel it was uploaded to? 那么可以确定上传的频道吗?

I see two options here. 我在这里看到两个选项。 You can : 您可以 :

  • add an in-app runtime mechanism to change environment. 添加应用内运行时机制以更改环境。 By default the app would use production env but you can change it using a hidden/secured menu 默认情况下,应用程序将使用生产环境,但您可以使用隐藏/安全菜单进行更改
  • upload a version on google play for each environment. 在Google Play上为每个环境上传一个版本。 You do some alpha/beta testing using test or staging environment and when everything is ok you promote the production build. 您可以使用测试或暂存环境进行一些alpha / beta测试,当一切正常时,您可以推广生产构建。 Still, you need to think carefully your package names or version codes... 不过,您需要仔细考虑您的包名或版本代码......

Hope it helps :) 希望能帮助到你 :)

You can't, as far as I know. 据我所知,你不能。 Besides if it was installed from beta you could later make that as the normal release anyways - so it's not the install source, but where it is currently that matters. 此外,如果它是从beta安装的,你可以稍后将其作为正常版本 - 所以它不是安装源,但它在当前重要的地方。 What you're doing is not alpha/beta testing in the sense that it's in the play store. 你正在做的不是alpha / beta测试,因为它在Play商店中。

But you could guess if it's the public version by checking from the store listing if the version number is greater than that. 但是你可以通过从商店列表中检查版本号是否大于公共版本来猜测它是否是公共版本。

Is it possible to detect that an android app is either a beta version or production version? 是否有可能检测到Android应用程序是测试版还是生产版? has some links into a google developer api to do basically just that(though I'm pretty sure you could just scrape it off the web too). 有一些链接到谷歌开发人员api基本上就是这样做(虽然我很确定你也可以把它从网上刮掉)。

All and all the system isn't really meant for staging testing in that sense where you would have them connect to a different environment, so you might just be better off planning your testing again. 所有这些系统都不是真正意义上的分段测试,在这种意义上你可以将它们连接到不同的环境,所以你可能最好再次规划测试。 It's more suited for actual beta testing before committing to updating all users of the application. 在提交更新应用程序的所有用户之前,它更适合实际的beta测试。

What could be an option for you then would be to create entirely different private products for each of the different servers/tracts you have (you'll need to change the app id though for those builds, but that might be for the better). 那么你可以选择为你拥有的每个不同的服务器/领域创建完全不同的私有产品(你需要为这些构建更改应用程序ID,但这可能会更好)。

edit: you can greatly simplify my first suggested solution/hack if you make the compromise of having the latest versions name be served from your own server, so you can check if your version number is greater than that then connect to beta,alpha or whatever api. 编辑:你可以大大简化我的第一个建议的解决方案/黑客,如果你妥协从你自己的服务器提供最新的版本名称,所以你可以检查你的版本号是否大于那,然后连接到beta,alpha或其他API。 This will complicate making the actual release as you need to remember to change this, however it would allow you to test the beta version on the actual production server too then before promoting it to the full release status. 这将使得实际发布变得复杂,因为您需要记住更改它,但是它允许您在将其升级到完整版本状态之前测试实际生产服务器上的测试版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM