{
  "id": 8832565,
  "title": "React Native Environment Setup: Managing Dev, Prod, and Staging Builds with Android Flavors and iOS Schemes",
  "url": "https://urgent.news/2026/09/21/react-native-environment-setup-managing-dev-prod-and-staging-builds",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-21T03:42:39.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/prabhasg56/react-native-environment-setup-managing-dev-prod-and-staging-builds-with-android-flavors-and-ios-1j2e"
  },
  "original_language": "en",
  "account": "The author aimed to simplify environment management for a React Native app with development and production builds. They wanted to automate the selection of correct API, Firebase, branch, payment environments, app ID, app name, and native configuration without manually editing source files before each build.\n\nTo achieve this, the author utilized three tools: react-native-config for environment variables, Android Product Flavors for separate development and production Android applications, and iOS Schemes + Build Configurations for the equivalent on iOS. They structured .env.dev and .env.prod files with environment-specific values, separate from application code.\n\nReact-native-config was chosen as it handles environment configuration in JavaScript, native Android, and iOS code. The application code consumes these variables from react-native-config, ensuring a single source of truth for environment configuration. React-native-config values are baked into the build process, meaning changing .env values requires a rebuild.\n\nFor Android, the author created dev and prod product flavors, assigning separate application IDs for each. This feature allows testing both versions on the same device without uninstalling. Android's product flavor build types (debug, release) combine with flavors, creating variants like devDebug, devRelease, prodDebug, and prodRelease.\n\nWhen building, the appropriate .env file is automatically selected based on the build variant, thus eliminating manual environment switching. Additionally, distinct app names and package IDs were configured for each flavor, making the two applications visually distinguishable.",
  "summary": "If you've worked on a React Native app that has both development and production environments , you probably know how quickly environment management becomes annoying. At the beginning, it usually looks simple: Development → API A Production → API B Then the app grows. Suddenly, you have different: API endpoints Firebase projects Branch environments Payment environments Analytics configuration Push…",
  "key_points": [
    "Created Android dev and prod product flavors with distinct application IDs for separate builds",
    "Configured iOS Schemes + Build Configurations for equivalent environment management on iOS"
  ],
  "editors_take": "This approach streamlines environment management for React Native apps by automating configuration selection, eliminating manual edits, and providing a single source of truth for environment settings across platforms.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}