Setting up build configurations (Debug, Release, Staging)

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Setting up build configurations (Debug, Release, Staging)
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Build Configuration Setup (Debug, Release, Staging)

Classic situation: production app ships with hardcoded https://api-dev.myapp.com in base URL. Or testers get build that logs everything to console and crashes from enabled StrictMode. Proper build configuration—each environment has own constants, behavior, settings, not scattered #if DEBUG across code.

iOS: Xcconfig + Build Configurations

Xcode by default has two build configurations: Debug and Release. Add Staging manually: Product → Scheme → Edit Scheme → Duplicate Release → rename to Staging.

Store configuration values in .xcconfig files:

// Config/Debug.xcconfig
API_BASE_URL = https://api-dev.myapp.com
LOG_LEVEL = verbose
BUNDLE_ID_SUFFIX = .debug

// Config/Staging.xcconfig
API_BASE_URL = https://api-staging.myapp.com
LOG_LEVEL = info
BUNDLE_ID_SUFFIX = .staging

// Config/Release.xcconfig
API_BASE_URL = https://api.myapp.com
LOG_LEVEL = error
BUNDLE_ID_SUFFIX =

In Info.plist values pulled via $(API_BASE_URL). In code read via Bundle.main.infoDictionary:

enum AppConfig {
    static var apiBaseURL: URL {
        guard let urlString = Bundle.main.object(forInfoDictionaryKey: "API_BASE_URL") as? String,
              let url = URL(string: urlString) else {
            fatalError("API_BASE_URL not configured")
        }
        return url
    }
}

No #if DEBUG for URLs—only Bundle.

Android: Build Types + Product Flavors

Android configurations managed via build.gradle.kts. Build Types (debug, release, staging) + Product Flavors (free, paid, enterprise) give variant matrix.

android {
    buildTypes {
        debug {
            applicationIdSuffix = ".debug"
            versionNameSuffix = "-debug"
            isDebuggable = true
            buildConfigField("String", "API_BASE_URL", "\"https://api-dev.myapp.com\"")
            buildConfigField("Boolean", "ENABLE_LOGGING", "true")
        }
        create("staging") {
            initWith(getByName("release"))
            applicationIdSuffix = ".staging"
            versionNameSuffix = "-staging"
            buildConfigField("String", "API_BASE_URL", "\"https://api-staging.myapp.com\"")
            buildConfigField("Boolean", "ENABLE_LOGGING", "true")
            signingConfig = signingConfigs.getByName("debug")
        }
        release {
            isMinifyEnabled = true
            buildConfigField("String", "API_BASE_URL", "\"https://api.myapp.com\"")
            buildConfigField("Boolean", "ENABLE_LOGGING", "false")
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
        }
    }
}

BuildConfig.API_BASE_URL accessible in code after build—generated class, not hardcoded string.

Icons and App Names per Configuration

Staging and Debug builds should visually differ from production. On iOS done via different AppIcon asset in Assets.xcassets + xcconfig condition (ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon-Staging). On Android—via src/debug/res/ and src/staging/res/ with separate ic_launcher and strings.xml (with different app_name).

React Native and Flutter

In React Native, environment configurations managed via react-native-config (.env.staging, .env.production) or via native build types/schemes above. Package react-native-config compiles variables into native code—values not accessible via process.env at JS runtime, safer.

In Flutter—--dart-define or --dart-define-from-file:

flutter build apk --dart-define=API_URL=https://api-staging.myapp.com --flavor staging

Workflow

Audit current configuration management approach → create xcconfig/buildTypes structure → migrate hardcoded values to configs → update CI for building needed variant → setup icons and names → document for team.

Timeline: 1–3 days. Cost calculated individually.