Neddar Islam
0%
📱Mobile Development
Featured

Setting Up Deployment to Google Play for Your Expo App

Complete guide covering two approaches to deploy your Expo React Native app to Google Play: using EAS Submit and traditional Fastlane setup with step-by-step instructions.

Islam Neddar
4 min read
expo
google-play
eas-submit
fastlane
android
deployment
mobile-development
react-native

Deploying your Expo React Native app to the Google Play Store is a crucial step in reaching your users. Whether you're publishing your first app or streamlining your deployment workflow, choosing the right deployment strategy can save you time and reduce complexity.

There are two main approaches to deploy your Expo app to Google Play:

  1. Using EAS Submit (Recommended for Expo apps)
  2. Setting up traditional Fastlane

This guide will walk you through both options, starting with the simpler EAS approach which is better integrated with your existing Expo setup, followed by the more customizable Fastlane option for advanced use cases.

If you already have an eas.json file with a submit configuration, you have a great start! Here's how to complete the setup:

1. Create a Google Play Service Account

  1. Go to the Google Play Console
  2. Navigate to Setup > API access
  3. Create a new service account or link an existing one
  4. Grant the necessary permissions (at minimum "Release Manager" role)
  5. Create and download the JSON key file
  6. Save this file in your project (e.g., as google-service-account.json)
  7. Add this file to your .gitignore to keep it secure

2. Update your EAS Submit Configuration

Update your eas.json file to point to the correct service account key path:

json
{
  "submit": {
    "production": {
      "android": {
        "serviceAccountKeyPath": "./google-service-account.json",
        "track": "production"
      }
    }
  }
}

You can also add other tracks like "internal", "alpha", or "beta" if needed.

3. Build a Production APK/AAB

Before submitting, you need to build a production version:

bash
eas build --platform android --profile production

4. Submit to Google Play

Once the build completes, submit it to Google Play:

bash
eas submit --platform android --profile production

Option 2: Setting Up Traditional Fastlane

If you need more customization or want to integrate with other CI/CD systems, traditional Fastlane is a good option:

1. Install Fastlane

bash
# Install Ruby if not already installed
brew install ruby

# Install Fastlane
gem install fastlane

2. Initialize Fastlane in your Android project

bash
cd android
fastlane init

Follow the prompts to set up your Fastlane configuration.

3. Set up your Fastfile

Create or modify android/fastlane/Fastfile with the following content:

ruby
default_platform(:android)

platform :android do
  desc "Deploy to Google Play"
  lane :deploy do
    # Build your Android app
    gradle(
      task: "bundle",
      build_type: "Release"
    )

    # Upload to Google Play
    upload_to_play_store(
      track: 'production',
      json_key: 'path/to/your/google-service-account.json',
      aab: 'app/build/outputs/bundle/release/app-release.aab'
    )
  end
end

4. Create a Keystore for Signing

If you don't already have a keystore:

bash
keytool -genkey -v -keystore android/app/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

5. Configure Gradle for Signing

Update your android/app/build.gradle file:

gradle
android {
    // ...
    signingConfigs {
        release {
            storeFile file('upload-keystore.jks')
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyAlias 'upload'
            keyPassword System.getenv("KEY_PASSWORD")
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            // ...
        }
    }
}

6. Run Fastlane

bash
cd android
fastlane deploy

Recommendation

For an Expo app, I recommend using EAS Submit (Option 1) because:

  1. It's better integrated with the Expo ecosystem
  2. It handles the build process automatically
  3. It manages app signing for you
  4. It's simpler to set up and maintain

The only prerequisite is to create and configure the Google Play service account key file, then update the path in your eas.json file.

Next Steps

  1. Create your Google Play service account and download the key file
  2. Update your eas.json with the correct path to the key file
  3. Run eas build followed by eas submit

Conclusion

Both deployment methods have their merits, but for most Expo developers, EAS Submit offers the best balance of simplicity and functionality. It integrates seamlessly with your existing Expo workflow and handles most of the complexity for you.

Choose EAS Submit if you:

  • Want a streamlined deployment process
  • Are already using EAS Build for your builds
  • Prefer minimal configuration and setup

Choose Fastlane if you:

  • Need advanced customization options
  • Want to integrate with existing CI/CD pipelines
  • Require more control over the build and deployment process

With either approach, you'll be able to successfully deploy your Expo React Native app to the Google Play Store and reach your Android users.

Share: