🗓️ Book Your Mobile CI/CD Assessment Session!
Learn More       Talk to an Expert
Logo
  • Get in Touch
  • Mail İcon
    info@appcircle.io

Follow us on:

  • Github IconX IconYoutube IconLinkedIn IconReddit Icon
ISO 27001SOC2 Type2
LinkedIn IconLinkedIn IconLinkedIn IconLinkedIn IconLinkedIn Icon
  • Product
  • Features
  • Why Appcircle?
  • Meet Our Customers
  • Enterprise
  • Self-Hosted Appcircle
  • Local macOS Services
  • Integrations
  • Appcircle AI
  • Use Cases
  • Guides
  • Pricing
  • System Status
  • CLI
  • Community
  • Partners
  • Blog
  • Events
  • Whitepapers
  • Guides and Docs
  • CI/CD Maturity Report
  • Release Notes
  • How-to Videos
  • Slack Channel
  • Getting Started
  • Compare
  • Mobile CI/CD Tools
  • Appcircle vs App Center
  • Appcircle vs Appflow
  • Appcircle vs Bitrise
  • Appcircle vs Codemagic
  • Appcircle vs Xcode Cloud
  • Appcircle vs Jenkins
  • Company
  • Mission and Vision
  • Contact Us
  • Careers
  • Press Kit
  • Product
  • Features
  • Why Appcircle?
  • Meet Our Customers
  • Enterprise
  • Self-Hosted Appcircle
  • Local macOS Services
  • Integrations
  • Appcircle AI
  • Use Cases
  • Guides
  • Pricing
  • System Status
  • CLI
  • Community
  • Partners
  • Blog
  • Events
  • Whitepapers
  • Guides and Docs
  • CI/CD Maturity Report
  • Release Notes
  • How-to Videos
  • Slack Channel
  • Getting Started
  • Compare
  • Mobile CI/CD Tools
  • Appcircle vs App Center
  • Appcircle vs Appflow
  • Appcircle vs Bitrise
  • Appcircle vs Codemagic
  • Appcircle vs Xcode Cloud
  • Appcircle vs Jenkins
  • Company
  • Mission and Vision
  • Contact Us
  • Careers
  • Press Kit

Copyright © 2024 Appcircle Inc. All rights reserved.

Terms of ServicePrivacy PolicyCookie PolicyInformation Security PolicySecurity in Appcircle
Appcircle LogoAppcircle Logo
Product
featuresFEATURES

Unlock the full potential of Mobile CI/CD with Appcircle's powerful features

enterprise
Build

Effortlessly Automate Your Mobile App Builds

enterprise
Enterprise App Store

Enterprise Mobile App Store

enterprise
Signing Identities

Complete Signing Identity Management

enterprise
Re-sign Binaries

Mastering Binary Re-signing for App Security

enterprise
Testing Distribution

Comprehensive App Distribution for Testing

codepush
CodePush

Seamless OTA Update Process

enterprise
Publish to Stores

Automate App Store Publishing from Days to Minutes

Microsoft Intune App Releases
Publish to Intune

Streamline Microsoft Intune App Releases

featuresPLATFORMS

Explore the mobile platforms comprehensively supported by Appcircle

enterprise
iOS CI/CD

iOS Continuous Integration and Delivery (CI/CD)

enterprise
Android CI/CD

Android Continuous Integration and Delivery (CI/CD)

enterprise
React Native CI/CD

React Native Continuous Integration and Delivery (CI/CD)

enterprise
Flutter CI/CD

Flutter Continuous Integration and Delivery (CI/CD)

featuresINTEGRATIONS

Streamlined Integration with Hundreds of Ready Workflow Steps!

Sonarqube

Sonarqube

Danger

Danger

Fastlane

Fastlane

Tuist

Tuist

BrowserStack

BrowserStack

Resources
RESOURCESRESOURCES

Comprehensive documentation to support you at every stage of your Appcircle journey.

Learn

enterprise

Docs

enterprise

Blogs

enterprise

Events

whitepapers

Whitepapers

enterprise

Videos

Get Started

enterprise

Objective-C/Swift

enterprise

Java/Kotlin

enterprise

React Native

enterprise

Flutter

Guides

enterprise

Continuous Testing

enterprise

Advanced Caching

enterprise

Marketplaces

enterprise

API & CLI

CONNECT

enterprise

LinkedIn

enterprise

X

enterprise

Slack Community

Enterprise
RESOURCESENTERPRISE

Experience Appcircle's robust, enterprise-grade capabilities tailored for advanced needs

enterprise
Mobile CI/CD at Scale
enterprise
OpenShift
self-hosted
Self-Hosted
enterprise
Kubernetes
enterprise
Meet Our Customers
enterprise
Docker
enterprise
Why Appcircle?
enterprise
Podman
BlogPricingContact Us
BlogPricingContact Us
Log in ➔Start for Free
  1. Home
  2. use-cases
  3. environment-variables
Using Environment Variables in iOS, and Android Projects

Using Environment Variables in iOS, and Android Projects

Managing environment variables is crucial for customizing build configurations and securely handling sensitive data like API keys and passwords. Appcircle provides a streamlined approach for defining, managing, and utilizing environment variables across iOS, and Android projects, ensuring flexible and secure build processes.

Creating Environment Variable Groups

Organize your environment variables into groups for better management and reuse across multiple projects or build profiles.

Adding Key and Text-Based Value Pairs

Add key-value pairs where the value is text. Sensitive values can be marked as secret to hide them during the build process.

Example: A development team adds key-value pairs for API_URL (https://api.example.com) and API_KEY (your_api_key_here, hidden) in the environment variable group.

Adding Files as Environment Variables

Include files as environment variables for use in build workflows, such as configuration files or certificates.

Example: A developer uploads a configuration file as an environment variable with the key CONFIG_FILE, which is then used during the build process.

Using Environment Variable Groups in Builds

Assign the created environment variable groups to your build profiles to make the variables available during the build.

Example: In the staging build configuration, the team assigns the "Staging" variable group, ensuring that staging-specific settings are applied during the build.

Using Environment Variables in iOS Projects

Integrate environment variables into iOS projects using Xcode configuration files (.xcconfig files). This allows you to manage project-wide variables without hardcoding sensitive information.

Example: A developer creates a .xcconfig file to store variables like API_URL and API_KEY. These variables are referenced in the project's Info.plist and accessed in the code. During the build process, Appcircle's custom scripts replace placeholders in the .xcconfig file with actual environment variable values, ensuring sensitive data is not exposed in the source code.

Using Environment Variables in Android Projects

Access environment variables in Android projects through Gradle build configurations. This method lets you define variables that can be used throughout your application.

Example: A developer modifies the build.gradle file to include environment variables for API_URL and API_KEY. These variables are then accessible in the application via the BuildConfig class. By assigning different variable groups in Appcircle, the developer can easily switch between development, staging, and production environments without changing the code.

Best Practices and Considerations

Security: Mark sensitive variables as secret in Appcircle to prevent exposure.

Environment-Specific Configurations: Create separate variable groups for different environments like development, staging, and production.

Consistent Naming Conventions: Use clear and consistent names for your variables and groups.

Avoid Hardcoding: Do not embed sensitive information in your source code; use environment variables instead.

REQUEST FOR MORE SPECIFICS

Get Started with Appcircle

Save time, reduce costs, and increase developer productivity

Join Our Newsletter

Get informed about news, new releases, and mobile DevOps.