简体   繁体   English

对于 Android 库,有没有办法检测宿主 Android 应用程序是 beta 测试版本还是生产版本

[英]For an Android library, is there a way to detect whether host Android app is a beta testing build vs production build

I'm building an android SDK/library.我正在构建一个 android SDK/库。

In the library I want to know whether app is either在图书馆我想知道 app 是否是

  • running on simulator在模拟器上运行
  • physical device物理设备
  • whether it's in beta testing on google play是否在 google play 上进行 beta 测试
  • or it's product build或者它的产品构建

Based on my knowledge, I can only detect simulator vs physical based on some checks on Build class values.根据我的知识,我只能根据对Build类值的一些检查来检测simulatorphysical And there is no way for library to know about beta testing vs production unless the developer of the app using the library provides that information via a public API除非使用该library的应用程序开发人员通过public API提供该信息,否则库无法了解beta testingproduction的情况

Could someone confirm this limitation OR provide some insights if there is a way to do this ?如果有办法做到这一点,有人可以确认这个限制或提供一些见解吗?

Reason is to route API calls and data to a particular endpoint so various data doesn't end up skewing production data.原因是将 API 调用和数据路由到特定端点,以便各种数据最终不会歪曲生产数据。

I can do that via different API Keys for all for cases, but that's off the limits right now.对于所有情况,我都可以通过不同的 API 密钥来做到这一点,但现在已经超出了限制。

I don't think its possible for a third-party library/SDK such as yours to know how, where, or when any developer is running in a testing/QA/production environment.我认为像您这样的第三方库/SDK 不可能知道任何开发人员在测试/QA/生产环境中运行的方式、地点或时间。 Any real device could be for development or production.任何真正的设备都可以用于开发或生产。

Even for the primary app developer deploying to the Google Play Store there are limited options for track detection as Is it possible to detect that an android app is either a beta version or production version?即使对于部署到 Google Play 商店的主要应用程序开发人员,跟踪检测的选项也有限,因为是否有可能检测到 Android 应用程序是测试版还是生产版? shows.显示。

I agree with you that if there are Development/QA/Production restrictions (ie your backend services) you'll need to provide a public API of some kind to your library to select the appropriate one as you've excluded different API keys.我同意您的看法,如果存在开发/质量保证/生产限制(即您的后端服务),您需要向您的库提供某种公共 API 以选择合适的 API,因为您已经排除了不同的 API 密钥。

Sadly you'll also have to be prepared that developers will release your library in the wrong state into production causing other business related effects (production data going to QA or the opposite).遗憾的是,您还必须做好准备,开发人员将以错误的状态将您的库发布到生产中,从而导致其他与业务相关的影响(生产数据进入 QA 或相反)。

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

相关问题 是否可以检测到 android 应用程序是测试版还是生产版? - Is it possible to detect that an android app is either a beta version or production version? 如何使用Android NDK构建主机静态库? - How to build host static library with Android NDK? 区分Android应用程序的调试和生产版本 - Differentiating debug and production build of an Android app 将Google的App Invites Beta与具有多种构建风格(生产,质量保证,调试等)的android应用一起使用 - Using Google's App Invites beta with an android app that has multiple build flavors (production, qa, debug, etc.) Android应用Beta测试推出与Google Play - Android app beta testing rollout vs Google Play 如果生成构建存在,则无法安装适用于Android的Crashlytics Beta版本:'该软件包与现有软件包冲突,名称相同' - Crashlytics Beta build for Android will not install if production build exists: 'The package conflicts with an existing package by the same name' android build发布到beta版本 - android build release to beta version 部署Android应用进行Beta测试 - Deploy Android App for Beta Testing 测试Android应用发布版本变体 - Testing Android app release build variant 从 Android Studio Beta 版本将应用程序发布到 Google Play? - Publish App to Google Play from Android Studio Beta build?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM