Configuring EAS Build (eas.json)
1. Creating EAS Configuration
Example: eas.json structure
{
"cli": {
"version": "latest"
},
"build": {
"production": {
"distribution": "store",
"android": {
"buildType": "app-bundle"
},
"ios": {
"buildType": "archive"
}
},
"development": {
"distribution": "internal",
"developmentClient": true
}
},
"submit": {
"production": {
"ios": {
"appleId": "user@example.com"
}
}
}
}
| Property | Description | Values |
|---|---|---|
| cli.version | Version of EAS CLI to use | "latest" or "1.0.0" |
| build.production | Configuration for production builds | Object with distribution, android, ios |
| build.development | Configuration for development builds | Object with distribution, developmentClient |
| submit.production | Configuration for submitting builds to app stores | Object with ios, android |
Note: The
eas.json file must be located in the root of your project.
Warning: Ensure that all paths in
eas.json are relative to the project root.
2. Defining Build Profiles
| Profile Name | Platform | Configuration | Notes |
|---|---|---|---|
| development | all |
|
For local development and testing |
| production | all |
|
For publishing to app stores |
| preview | all |
|
For sharing builds with testers |
Example: eas.json build profile configuration
{
"build": {
"production": {
"developmentClient": false,
"distribution": "store",
"channel": "production"
},
"preview": {
"developmentClient": false,
"distribution": "internal",
"channel": "preview"
}
}
}
3. Setting Distribution Mode
| Mode | Description | Configuration | Notes |
|---|---|---|---|
| release | Builds for production distribution | "release": true |
Default for EAS Build |
| development | Builds for local development and testing | "release": false |
Includes debug info and development tools |
| preview | Builds for preview distribution (e.g., EAS Update) | "release": false |
Enables EAS Update features |
Example: Setting Distribution Mode in eas.json
{
"build": {
"release": true,
"env": {
"EXPO_PUBLIC_ENV": "production"
}
}
}
4. Configuring Android Build
| Property | Values | Description |
|---|---|---|
| build.android.versionCode | 1 |
Version code for Android builds. Must be an integer. |
| build.android.buildType | app-bundle, apk |
Build type for Android. Defaults to app-bundle. |
| build.android.signing | auto, manual |
Signing mode. auto uses EAS-managed signing. |
| build.android.gradleAppId | com.example.app |
Application ID for Android builds. |
| build.android.icon | ./assets/icon.png |
Path to the Android app icon. |
| build.android.permissions | ["CAMERA", "ACCESS_FINE_LOCATION"] |
List of Android permissions required. |
| build.android.config | ./android/app.json |
Path to Android-specific config file. |
Example: eas.json configuration for Android
{
"build": {
"android": {
"versionCode": 1,
"buildType": "app-bundle",
"signing": "auto",
"gradleAppId": "com.example.app",
"icon": "./assets/icon.png",
"permissions": ["CAMERA", "ACCESS_FINE_LOCATION"],
"config": "./android/app.json"
}
}
}
Note: Ensure
versionCode is incremented for each release.
5. Configuring iOS Build
| Property | Values | Description |
|---|---|---|
| build.ios.bundleIdentifier | string |
Unique identifier for the iOS app. Required for building. |
| build.ios.config | string |
Path to the EAS build configuration file (e.g., eas-build.json). |
| build.ios.distribution | 'app-store' | 'ad-hoc' | 'enterprise' |
Target distribution method for the iOS build. |
| build.ios.provisioningProfile | string |
Path to the provisioning profile for code signing. |
| build.ios.signingCertificate | string |
Path to the code signing certificate. |
| build.ios.signingIdentity | string |
Name of the signing identity in the keychain. |
| build.ios.teamId | string |
Apple Developer Team ID used for code signing. |
| build.ios.version | string |
Version string for the iOS app (e.g., 1.0.0). |
Example: eas.json iOS build configuration
{
"build": {
"ios": {
"bundleIdentifier": "com.example.myapp",
"distribution": "app-store",
"teamId": "ABC123DEF456",
"version": "1.0.0"
}
}
}
6. Setting Build Environment Variables
| Variable | Value | Description |
|---|---|---|
| EAS_BUILD_ENV | production |
Environment for the build process |
| EXPO_PUBLIC_API_URL | https://api.myapp.com |
Public API endpoint used in the app |
| EXPO_PUBLIC_APP_VERSION | 1.2.3 |
Current version of the app exposed to the client |
Example: Setting Environment Variables in eas.json
{
"build": {
"production": {
"env": {
"EXPO_PUBLIC_API_URL": "https://api.myapp.com",
"EXPO_PUBLIC_APP_VERSION": "1.2.3"
}
}
}
}
7. Using Credentials Source
| Property | Values | Description |
|---|---|---|
| credentialsSource | local | managed |
Specifies where credentials are stored. local stores them in the project's eas.json file. managed uses EAS credentials managed by Expo. |
Example: Setting credentialsSource to local
{
"build": {
"production": {
"credentialsSource": "local"
}
}
}
Example: Setting credentialsSource to managed
{
"build": {
"production": {
"credentialsSource": "managed"
}
}
}
8. Setting Build Type
| Property | Values | Description |
|---|---|---|
| buildType | app-bundle, apk |
Specifies the type of build to generate. app-bundle is for Android App Bundles, apk is for Android Package files. |
Example: Setting Build Type in eas.json
{
"build": {
"production": {
"buildType": "app-bundle"
}
}
}
9. Configuring App Extensions
| Property | Description | Values |
|---|---|---|
| appExtensions | Defines app extensions for the project | object |
Example: Configuring App Extensions
{
"appExtensions": {
"notificationService": {
"name": "Notification Service Extension",
"platforms": ["ios", "android"]
}
}
}
10. Setting Resource Class
| Property | Values | Description |
|---|---|---|
| resourceClass | medium, large, xlarge |
Specifies the resource class to use for building your app. NEW |
11. Using Custom Build Config
Example: Custom EAS Build Configuration
{
"build": {
"production": {
"android": {
"buildType": "app-bundle",
"gradleCommand": ":app:bundleRelease"
},
"ios": {
"buildType": "archive",
"scheme": "MyApp"
}
},
"staging": {
"android": {
"buildType": "apk",
"gradleCommand": ":app:assembleDebug"
},
"ios": {
"buildType": "simulator",
"scheme": "MyAppStaging"
}
}
}
}
| Property | Description | Values | Notes |
|---|---|---|---|
| buildType | Specifies the type of build to generate | app-bundle, apk, archive, simulator |
For Android, use app-bundle for Play Store. For iOS, use archive for distribution. |
| gradleCommand | Custom Gradle command to run for Android builds | :app:bundleRelease, :app:assembleDebug |
Use this to override default build commands. Must be a valid Gradle task. |
| scheme | Build scheme for iOS builds | MyApp, MyAppStaging |
Must match the scheme in Xcode project. |
Note: Custom build configurations are applied only to builds created with EAS Build. They do not affect local builds.
12. Configuring Build Hooks
| Hook | Description | Usage |
|---|---|---|
| build.pre | Runs before the build process starts | "build.pre": "echo 'Starting build...'" |
| build.post | Runs after the build completes successfully | "build.post": "echo 'Build completed!'" |
| build.error | Runs if the build fails | "build.error": "echo 'Build failed!'" |