fluttertestinggoogle-playapp-store-connectenvironment

Is it possible to know if a flutter app is running on Production or in a Test Environment?


Google Play has different deployment environments for Android apps, like Production, Open Test track, Closed Test track, and Internal Test.

Similarly, Apple App Store Connect allows us to deploy either in production or to TestFlight and other testing environments.

Is it possible to know if a flutter app is running in Production or in one of these test environments? My use case is that I would like to enable some debugging and troubleshooting features in my app only when it is not deployed in Production, if possible.

Please bear in mind I am not looking for Dart isDebug variable, since apps published on the test environments are also built on release mode, so this is not the solution I need.


Solution

  • By using https://pub.dev/packages/store_checker package it's possible to check if the running app has been downloaded from Google Play Store, Apple App Store, Apple Testflight, Amazon, etc.

    It may potentially resolve the issue of determining if the application is running on PROD or QA environments, or in a different environment.