Skip to main content

Building with EAS

1. Installing EAS CLI

The EAS CLI is the primary command-line tool for building and managing Expo applications with EAS Build and EAS Submit.

Installation Method Command Notes
npm npm install -g @expo/eas-cli Installs EAS CLI globally using npm
yarn yarn global add @expo/eas-cli Installs EAS CLI globally using yarn
pnpm pnpm add -g @expo/eas-cli Installs EAS CLI globally using pnpm

Example: Verify Installation

eas --version
Note: Ensure Node.js version 18 or higher is installed before installing EAS CLI.

2. Logging In

Example: EAS CLI Login

eas login
Command Description Notes
eas login Logs into your Expo account Requires valid credentials
eas login --token <token> Logs in using a token Useful for CI/CD environments
Note: You need an Expo account to use EAS. If you don't have one, create it at https://expo.dev.

3. Configuring Project

Property Values Description
expo.config object Root configuration object for the Expo project
expo.name string Name of the app as displayed in stores and on devices
expo.slug string Unique identifier for the app in Expo ecosystem
expo.version string Version of the app, used for updates and store submissions
expo.platform string Platform-specific configuration (e.g., ios, android)
expo.bundleIdentifier string Unique identifier for the app on iOS and Android (e.g., com.example.myapp)
expo.ios.buildNumber string Build number for iOS builds (e.g., 1.0.0)
expo.android.versionCode number Version code for Android builds (e.g., 1)
expo.icon string Path to the app icon (e.g., ./assets/icon.png)
expo.splash.image string Path to the splash screen image (e.g., ./assets/splash.png)
expo.splash.resizeMode string Resize mode for splash screen (e.g., contain, cover)
expo.orientation string Orientation of the app (e.g., portrait, landscape)
expo.backgroundColor string Background color for the app (e.g., #ffffff)
expo.scheme string Custom URI scheme for deep linking (e.g., myapp)
expo.permissions array Permissions required by the app (e.g., ["camera", "location"])
expo.plugins array List of plugins to include in the project (e.g., ["expo-camera"])
expo.extra object Custom configuration values accessible at runtime (e.g., { apiEndpoint: "https://api.example.com" })

Example: Basic project configuration

{
  "expo": {
    "name": "MyApp",
    "slug": "my-app",
    "version": "1.0.0",
    "platform": {
      "ios": {
        "buildNumber": "1.0.0"
      },
      "android": {
        "versionCode": 1
      }
    },
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain"
    },
    "orientation": "portrait",
    "backgroundColor": "#ffffff",
    "scheme": "myapp",
    "permissions": ["camera", "location"],
    "plugins": ["expo-camera"],
    "extra": {
      "apiEndpoint": "https://api.example.com"
    }
  }
}

4. Building for Android

Property Value Description
eas.build.android.image ubuntu-20.04-node-18 Base image used for building Android apps
eas.build.android.ndkVersion 21.4.7075529 Version of the Android NDK to use
eas.build.android.gradleVersion 7.4.2 Gradle version used for building

Example: Building for Android

eas build --platform android
Note: Ensure that your eas.json is configured correctly for Android builds.
Warning: Make sure to have the correct keystore and key alias configured in eas.json for signing your Android app.
Build Type Command Description
Development eas build --platform android --profile development Builds a debug APK for local testing
Production eas build --platform android --profile production Builds a release APK for distribution

5. Building for iOS

Property Value Description
eas.build.ios.release true Enables building for release on iOS
eas.build.ios.simulator false Enables building for simulator on iOS
eas.build.ios.provisioningProfile string Path to provisioning profile for iOS
eas.build.ios.codeSigning true Enables code signing for iOS builds

Example: Building for iOS Release

eas build --platform ios --release

Example: Building for iOS Simulator

eas build --platform ios --simulator
Note: Ensure you have configured your iOS credentials in EAS Build settings before running the build command.

6. Building for All Platforms

Platform Build Command Notes
iOS eas build --platform ios Requires macOS or CI/CD with Xcode
Android eas build --platform android Requires Android SDK or CI/CD with Gradle
Web eas build --platform web Uses React Native Web under the hood

Example: Building for iOS

eas build --platform ios

Example: Building for Android

eas build --platform android

Example: Building for Web

eas build --platform web
Note: EAS Build supports building for multiple platforms in a single command using eas build --platform all.

7. Using Build Profiles

Profile Name Platform Description Configuration
development all For local development and testing builds { "development": { "distribution": "internal", "buildType": "apk" } }
preview all For sharing builds with team members or stakeholders { "preview": { "distribution": "internal", "buildType": "aab" } }
production all For publishing to app stores { "production": { "distribution": "store", "buildType": "aab" } }

Example: Configuring Build Profiles

{
  "build": {
    "development": {
      "distribution": "internal",
      "buildType": "apk",
      "channel": "dev-channel"
    },
    "preview": {
      "distribution": "internal",
      "buildType": "aab",
      "channel": "preview-channel"
    },
    "production": {
      "distribution": "store",
      "buildType": "aab",
      "channel": "production-channel"
    }
  }
}
Note: Build profiles are defined in eas.json and allow you to configure different build settings for various environments like development, preview, and production.

8. Building Locally

Command Description Notes
eas build:local Builds the app locally using the EAS Build service Requires eas-cli installed
eas build:local --platform ios Builds the iOS version of the app Must have Xcode installed and configured
eas build:local --platform android Builds the Android version of the app Must have Android Studio or SDK installed

Example: Building for iOS

eas build:local --platform ios

Example: Building for Android

eas build:local --platform android
Note: Ensure that your project is properly configured in eas.json before running local builds.

9. Checking Build Status

Example: Check EAS Build Status

eas build:list
Command Description Notes
eas build:list List all builds for the project Shows build ID, status, platform, and created date
eas build:status <build-id> Get detailed status of a specific build Use build ID from eas build:list
Note: Build status can be pending, running, success, or failed.

10. Downloading Builds

Build Type Download Method Notes
Managed eas build:download For builds created with EAS Build in managed workflow
Bare eas build:download For builds created with EAS Build in bare workflow

Example: Downloading a Managed Build

eas build:download --platform android --build-id 1234567890

Example: Downloading a Bare Build

eas build:download --platform ios --build-id 0987654321
Note: The --build-id is obtained from the EAS Build dashboard or via the eas build:list command.
Warning: Ensure that the build was created with the same project configuration (e.g., app version, SDK version) to avoid compatibility issues.

11. Inspecting Build

Property Description Value
buildId Unique identifier for the build 1234567890
status Current status of the build success
platform Platform the build was created for ios
buildTime Duration of the build process 2m 30s

Example: Build Log Inspection

$ eas build:inspect --build-id 1234567890
Build ID: 1234567890
Status: success
Platform: ios
Build Time: 2m 30s
Logs:
[INFO] Starting build process...
[INFO] Building for iOS...
[SUCCESS] Build completed successfully

12. Managing Credentials

Property Value Description
eas.credentials {} Configuration object for EAS credential management
eas.credentials.android {} Android-specific credential configuration
eas.credentials.ios {} iOS-specific credential configuration

Example: Setting up Android Credentials

{
  "eas": {
    "credentials": {
      "android": {
        "keystore": {
          "keystorePath": "android/keystore.jks",
          "keystorePassword": "secret",
          "keyAlias": "my-key-alias",
          "keyPassword": "secret"
        }
      }
    }
  }
}

Example: Setting up iOS Credentials

{
  "eas": {
    "credentials": {
      "ios": {
        "provisioningProfilePath": "ios/ProvisioningProfile.mobileprovision",
        "distributionCertificate": {
          "path": "ios/DistributionCertificate.p12",
          "password": "secret"
        }
      }
    }
  }
}
Note: Credentials are managed securely by EAS and never stored in your repository.
Warning: Ensure keystore and certificate passwords are kept secure and not exposed in version control.

Was this article helpful?