🚀

React Native Deployment

Deploy your React Native apps to app stores

Learn how to build, sign, and deploy your React Native applications to Google Play Store and Apple App Store. This guide covers the complete deployment process, optimization techniques, and CI/CD setup.

Pre-deployment Checklist

📋 Before You Deploy

App Configuration

  • • Update app version and build number
  • • Configure app icons for all sizes
  • • Set up launch screens/splash screens
  • • Update app name and bundle identifier
  • • Configure app permissions properly

Testing & Quality

  • • Test on real devices (iOS and Android)
  • • Verify all features work in release mode
  • • Check performance and memory usage
  • • Test offline functionality
  • • Validate app store guidelines compliance

Platform-specific Deployment

Android Deployment

Generate Signed APK/AAB

Create a signed build for Google Play Store

# Generate a signing key
keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

# Place keystore in android/app/
# Configure gradle.properties and build.gradle

# Build signed APK
cd android
./gradlew assembleRelease

# Build signed AAB (recommended for Play Store)
./gradlew bundleRelease

Configure Gradle Files

Set up signing configuration in Android project

// android/gradle.properties
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=*****
MYAPP_UPLOAD_KEY_PASSWORD=*****

// android/app/build.gradle
android {
    signingConfigs {
        release {
            if (project.hasProperty("MYAPP_UPLOAD_STORE_FILE")) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

iOS Deployment

Configure Xcode Project

Set up signing and provisioning profiles

# Open iOS project in Xcode
open ios/YourApp.xcworkspace

# In Xcode:
1. Select your project in navigator
2. Go to Signing & Capabilities
3. Select your Team
4. Choose Bundle Identifier
5. Ensure "Automatically manage signing" is checked

# Build for device
npx react-native run-ios --device

# Archive for App Store
# Product → Archive in Xcode

App Store Connect Setup

Prepare app listing and metadata

# Required assets:
- App icons (various sizes)
- Launch screens
- Screenshots for all device sizes
- App description and keywords
- Privacy policy URL

# Upload build using Xcode Organizer
# or Application Loader

# Submit for review through
# App Store Connect dashboard

Build Optimization

Bundle Size Optimization

Reduce app size for faster downloads

Techniques:

  • Enable Proguard/R8 for Android
  • Use Hermes JavaScript engine
  • Remove unused dependencies
  • Optimize images and assets
  • Use vector graphics when possible
  • Enable app bundle splitting

Configuration:

// android/app/build.gradle
android {
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
}

// Enable Hermes
project.ext.react = [
    enableHermes: true
]

Performance Optimization

Improve app startup and runtime performance

Techniques:

  • Enable Hermes JavaScript engine
  • Use Flipper for performance profiling
  • Optimize images and reduce bundle size
  • Implement code splitting
  • Use FlatList for large lists
  • Minimize bridge calls

Configuration:

// metro.config.js
module.exports = {
  transformer: {
    minifierConfig: {
      keep_fnames: true,
      mangle: {
        keep_fnames: true,
      },
    },
  },
};

// Enable RAM bundles for better startup
project.ext.react = [
    bundleInRelease: true,
    bundleInDebug: false
]

CI/CD Automation

GitHub Actions

Automated builds and deployments using GitHub Actions

# .github/workflows/build.yml
name: Build and Deploy

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build-android:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    
    - name: Setup Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '18'
        cache: 'npm'
    
    - name: Install dependencies
      run: npm ci
    
    - name: Setup Java
      uses: actions/setup-java@v3
      with:
        distribution: 'temurin'
        java-version: '11'
    
    - name: Build Android
      run: |
        cd android
        ./gradlew assembleRelease
    
    - name: Upload APK
      uses: actions/upload-artifact@v3
      with:
        name: app-release.apk
        path: android/app/build/outputs/apk/release/app-release.apk

  build-ios:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v3
    
    - name: Setup Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '18'
        cache: 'npm'
    
    - name: Install dependencies
      run: npm ci
    
    - name: Install CocoaPods
      run: |
        cd ios
        pod install
    
    - name: Build iOS
      run: |
        npx react-native run-ios --configuration Release

Fastlane

Automate iOS and Android deployments

# Gemfile
source "https://rubygems.org"
gem "fastlane"

# fastlane/Fastfile
default_platform(:ios)

platform :ios do
  desc "Build and upload to TestFlight"
  lane :beta do
    build_app(scheme: "YourApp")
    upload_to_testflight
  end
  
  desc "Deploy to App Store"
  lane :release do
    build_app(scheme: "YourApp")
    upload_to_app_store
  end
end

platform :android do
  desc "Deploy to Google Play"
  lane :deploy do
    gradle(task: "bundleRelease")
    upload_to_play_store
  end
end

App Store Guidelines

🍎 Apple App Store

  • • Follow Human Interface Guidelines
  • • Implement proper privacy policies
  • • Use only approved APIs and frameworks
  • • Provide clear app descriptions
  • • Include proper age ratings
  • • Test on multiple iOS versions
  • • Avoid duplicate functionality

🤖 Google Play Store

  • • Follow Material Design guidelines
  • • Implement proper permissions
  • • Provide clear privacy policy
  • • Use appropriate content ratings
  • • Test on various Android versions
  • • Optimize for different screen sizes
  • • Follow security best practices

Post-deployment Monitoring

Crash Reporting

  • • Crashlytics (Firebase)
  • • Sentry
  • • Bugsnag
  • • App Center Crashes

Analytics

  • • Google Analytics
  • • Firebase Analytics
  • • Mixpanel
  • • Amplitude

Performance

  • • Firebase Performance
  • • New Relic
  • • Datadog
  • • App Center Analytics

🎯 Final Deployment Checklist

Technical

  • ✅ App builds successfully in release mode
  • ✅ All features tested on real devices
  • ✅ Performance optimizations applied
  • ✅ Crash reporting and analytics integrated
  • ✅ App signed with proper certificates

Store Submission

  • ✅ App store listings completed
  • ✅ Screenshots and metadata uploaded
  • ✅ Privacy policy and terms of service ready
  • ✅ Age ratings and content warnings set
  • ✅ Release notes prepared