builds.android.PROFILE_NAME.credentialsSource setting
The `builds.android.PROFILE_NAME.credentialsSource` setting determines where credentials are obtained for Android builds. Credentials can be obtained from either the local credentials.json file or from EAS servers. If the `remote` mode is selected but no credentials exist yet, you are prompted to generate a new keystore.
builds.android.PROFILE_NAME.applicationArchivePath setting
The `builds.android.PROFILE_NAME.applicationArchivePath` setting in eas.json configures the artifact path for the application archive. It defaults to `android/app/build/outputs/**/*.{apk,aab}` and uses glob patterns for pattern matching.
builds.android.PROFILE_NAME.withoutCredentials setting
The `builds.android.PROFILE_NAME.withoutCredentials` setting allows you to skip credential preparation for Android builds. When set to `true`, EAS CLI will not prepare credentials needed for the build.
buildArtifactPaths setting for artifact archive
If `buildArtifactPaths` is specified in the build profile, EAS Build will upload the build artifacts archive to a private GCS bucket.
cache.key build profile setting
The `cache.key` value in the build profile is used to identify and restore a previously saved cache. The cache is restored during the remote build phase after the eas-build-post-install script runs.
builds.android.PROFILE_NAME.gradleCommand setting
The `builds.android.PROFILE_NAME.gradleCommand` setting in eas.json defines which Gradle command to run during the build. It defaults to `:app:bundleRelease` which produces the AAB (Android App Bundle).
Disable cache restoration for production builds example
You can disable cache restoration for specific build profiles by configuring these environment variables in eas.json: set EAS_RESTORE_CACHE to "0" and EAS_SAVE_CACHE to "1" for production profile, and EAS_USE_CACHE to "1" for preview profile to enable both restoring and saving cache.
iOS build cache configuration
EAS Build restores a previously saved cache identified by the `cache.key` value in the build profile. Podfile.lock is cached by default. Subsequent builds will restore this cache.
iOS build buildArtifactPaths configuration
If `buildArtifactPaths` is specified in the build profile in eas.json, EAS Build uploads the build artifacts archive to a private GCS bucket.
iOS build artifact path configuration
The artifact path can be configured in eas.json at `builds.ios.PROFILE_NAME.applicationArchivePath`. It defaults to `ios/build/App.ipa`. You can specify a glob-like pattern for `applicationArchivePath` using glob patterns for pattern matching.
eas.json ascAppId configuration for non-interactive testflight
In eas.json, configure non-interactive mode for npx testflight by adding ascAppId under submit.production.ios: {"submit": {"production": {"ios": {"ascAppId": "your-app-store-connect-app-id"}}}}
Environment variables example
To configure environment variables across profiles: { build: { production: { node: 16.13.0, env: { API_URL: https://company.com/api } }, preview: { extends: production, distribution: internal, env: { API_URL: https://staging.company.com/api } } } }.
Existing React Native project with multiple profiles example
An existing React Native project example with base, development, staging, and production profiles: { build: { base: { env: { EXAMPLE_ENV: example value }, android: { image: ubuntu-18.04-android-30-ndk-r19c, ndk: 21.4.7075529 }, ios: { image: latest, node: 12.13.0, yarn: 1.22.5 } }, development: { extends: base, env: { ENVIRONMENT: staging }, android: { distribution: internal, withoutCredentials: true, gradleCommand: :app:assembleDebug }, ios: { simulator: true, buildConfiguration: Debug } }, staging: { extends: base, env: { ENVIRONMENT: staging }, distribution: internal, android: { gradleCommand: :app:assembleRelease } }, production: { extends: base, env: { ENVIRONMENT: production } } } }.
Build profiles definition and usage
A build profile is a named group of configurations that describes the necessary parameters to perform a certain type of build. The JSON object under the build key can contain multiple build profiles with custom names. To run a build with a specific profile, use the command: eas build --profile <profile-name>. If the --profile flag is omitted, EAS CLI will default to using the profile named production if it exists.
Development builds configuration
Development builds are configured with developmentClient: true and distribution: internal by default. They include developer tools and are never submitted to an app store. Development builds depend on expo-dev-client. They can be configured to run on the iOS Simulator by setting ios.simulator: true. For iOS Simulator builds separate from internal distribution, create a separate profile with a custom name like development-simulator.
Build tool versions configuration
Versions for build tools can be set on build profiles with fields corresponding to tool names. Common configurable tools include: node, npm, yarn, ruby, bundler, cocoapods, fastlane, xcode, and android ndk. For example, you can set node: 18.18.0 in a build profile. Build tool configurations can be shared between profiles using the extends option.
CLI configuration in eas.json
The eas.json file can contain a cli section with the following properties: version (required EAS CLI version range, SEMVER_RANGE), requireCommit (if true, ensures all changes are committed before a build, defaults to false), appVersionSource (if set to remote, values stored on EAS servers take precedence over local values, defaults to local), promptToConfigurePushNotifications (if set to false, skips Push Notifications credentials setup for EAS Build, defaults to true).
Minimal preview profile example
A minimal preview profile requires only: { build: { preview: { distribution: internal } } }. Like development builds, preview builds can be configured to run on the iOS Simulator, or you can create a variant profile for that purpose. No such configuration is required for Android as the same .apk will run on both device and Android Emulator.
Minimal production profile example
A minimal production profile can be empty: { build: { production: {} } }.
Build tool versions with extends example
To share build tool configurations between profiles using extends: { build: { production: { node: 18.18.0 }, preview: { extends: production, distribution: internal }, development: { extends: production, developmentClient: true, distribution: internal } } }.
Resource class configuration example
To configure different resource classes for different platforms: { build: { production: { android: { resourceClass: medium }, ios: { resourceClass: large } } } }.
CNG project with multiple profiles example
A Continuous Native Generation project example with base, development, staging, and production profiles using extends and platform-specific configuration: { build: { base: { node: 12.13.0, yarn: 1.22.5, env: { EXAMPLE_ENV: example value }, android: { image: default, env: { PLATFORM: android } }, ios: { image: latest, env: { PLATFORM: ios } } }, development: { extends: base, developmentClient: true, env: { ENVIRONMENT: development }, android: { distribution: internal, withoutCredentials: true }, ios: { simulator: true } }, staging: { extends: base, env: { ENVIRONMENT: staging }, distribution: internal, android: { buildType: apk } }, production: { extends: base, env: { ENVIRONMENT: production } } } }.
Internal distribution configuration
To configure a build profile for internal distribution, set `"distribution": "internal"` on the profile.
Additional build configuration requirements
Additional configuration may be required depending on your project: (1) For environment variables, add them to your build configuration. (2) For monorepo projects, follow specific instructions for building with monorepos. (3) For private npm packages, add your npm token. (4) For specific tool versions (Node, Yarn, npm, CocoaPods, Xcode), specify these versions in your eas.json build configuration.
Channel property in eas.json example
Example configuration showing how to set channels for different build profiles: the production profile has channel "production", and the preview profile has channel "staging" with distribution "internal".
eas.json config property single file example
To reference a single custom build config file for all platforms, add the 'config' property to a build profile:
```json
{
"build": {
"test": {
"config": "test.yml"
}
}
}
```
eas.json config property separate platform files
To use separate custom build configs for iOS and Android platforms, nest the 'config' property under platform-specific keys:
```json
{
"build": {
"test": {
"ios": {
"config": "hello-ios.yml"
},
"android": {
"config": "hello-android.yml"
}
}
}
}
```
Asset selection requires JavaScript code requirements
After adding asset selection configuration, you must ensure that the assets matching the patterns are required in your JavaScript code for them to be included in updates.
app.json structure for EAS Update
Your project must have an app.json file with an expo object. At minimum, this can be an empty object: {"expo": {}}. Any existing keys should be preserved in this configuration.
eas.json build profile and channel structure
The eas.json file build section should have profiles that map to channels. A basic configuration includes: production profile with channel 'production', staging profile with channel 'staging', and preview profile with channel 'preview' and distribution 'internal'. Each profile should have a 'channel' field that specifies which channel updates from that build profile will be published to.
Channel configuration in eas.json for EAS Build
When using EAS Build, eas update:configure sets the channel property on preview and production profiles in eas.json. The preview profile gets channel: preview and the production profile gets channel: production.
eas.json request proxying configuration example
{
"cli": {
"updateAssetHostOverride": "updates-asset-proxy.example.com",
"updateManifestHostOverride": "updates-manifest-proxy.example.com"
}
}
Environment variable visibility settings
There are three visibility settings for environment variables: Plain text (visible on website, in EAS CLI, and in logs), Sensitive (obfuscated in build and workflow logs, togglable on website, readable in CLI), and Secret (not readable outside EAS servers, obfuscated in build and workflow logs).
Secret variables do not provide client-side security
Secret type environment variables are intended only to provide values to EAS Build or Workflows jobs to alter how a job runs (such as NPM_TOKEN). Secrets do not provide additional security for values embedded in the application itself, as anything in client-side code should be considered public.
.env file not listed in .gitignore or .easignore for EAS commands
To use .env files with EAS commands like eas build and eas update, the .env file must not be listed inside .gitignore or .easignore files so that EAS can pick it up.
environment field in eas.json build profiles
The environment field can be specified in the build profiles settings in the eas.json file to have full control over the environments used for your builds. Each profile (development, preview, production, or custom profiles) can specify an environment value.
EAS Submit configuration uses submit key in eas.json
The submit key in eas.json contains configuration properties for EAS Submit to configure app store submission.
Example eas.json build profiles with base, development, staging, and production
Example eas.json showing multiple build profiles: base profile defines common properties (node version 12.13.0, yarn version 1.22.5, and environment variables); development profile extends base with developmentClient true and android distribution internal; staging profile extends base with android buildType apk; production profile extends base with production environment.
EAS Build configuration uses build key in eas.json
The build key in eas.json contains configuration properties for EAS Build. Build profiles can extend other profiles using the extends property.
EAS Build common properties for native platforms
EAS Build supports common properties that apply to both Android and iOS platforms in the build configuration.
metadataPath in eas.json for store config
The metadataPath property in the eas.json submit configuration allows specifying a custom path for the store config file. Example: in submit.production.ios, set metadataPath to './store.config.js' to use a JavaScript config file instead of the default store.config.json.
Be cautious with EAS Update and APP_VARIANT environment variables
When using EAS Update to publish JavaScript updates of the app, be cautious to set the correct environment variables for the app variant being published. See the EAS Build Environment variables and secrets documentation for more information.
Example eas.json with APP_VARIANT and gradleCommand
{ "build": { "development": { "developmentClient": true, "env": { "APP_VARIANT": "development" }, "android": { "gradleCommand": ":app:assembleDevelopmentDebug" } }, "production": { "android": { "gradleCommand": ":app:bundleProductionRelease" } } } }
Production variant runs without APP_VARIANT set
When running eas build --profile production, the APP_VARIANT environment variable is not set, and the build runs as the production variant.
eas.json image field required for GitHub builds
To trigger builds from GitHub using the Expo GitHub App, you must specify an image field in eas.json for each build profile you want to use with GitHub. For native platforms (android and ios), set the image value to 'latest' if your project configuration does not rely on a specific build image. Example: under build.production.android and build.production.ios, add "image": "latest".
Profile selection during submission
When you select a build for submission, the system chooses the profile that is used for the selected build. If the profile does not exist, it selects the default production profile.
Profile extension depth limit
You can chain profile extensions up to a depth of 5 as long as you avoid making circular dependencies.
cli.requireCommit property in eas.json
The cli.requireCommit property in eas.json is a boolean that, if true, ensures that all changes are committed before a build. It defaults to false.
Production profile is default for eas submit
Running eas submit without specifying a profile name will use the production profile if it is already defined in eas.json to configure the submission. If no values exist in the production profile, EAS CLI will prompt you to provide the values interactively.
Production profile required for CI/CD workflows
The production profile shown in eas.json is required to run Android and iOS submissions in a CI/CD process, such as with EAS Workflows.
Minimal production profile example
A minimal production profile for EAS Submit should contain cli version requirement and submit configuration with android and ios sections. Example: {"cli": {"version": ">= 0.34.0"}, "submit": {"production": {"android": {"track": "internal"}, "ios": {"ascAppId": "your-app-store-connect-app-id"}}}}
Extend submit profiles with extends key
A submit profile can extend another profile using the extends key. For example, a preview profile can have "extends": "production" to inherit the configuration of the production profile.
App Store Connect app record creation with eas.json
You can create an app record in App Store Connect manually or set `ascAppId` in your submit profile in eas.json to skip creating an app record. Alternatively, `eas submit` creates an app record automatically when you submit your first build.
Android build artifact path default pattern
The default artifact path for Android builds is android/app/build/outputs/**/*.{apk,aab}, using glob patterns for matching. This can be customized by setting builds.android.PROFILE_NAME.applicationArchivePath in eas.json.
Default Android gradle command in EAS Build
The default gradle command for Android builds is :app:bundleRelease, which produces the AAB (Android App Bundle). This is the value used if no custom command is defined at builds.android.PROFILE_NAME.gradleCommand in eas.json.
Default eas.json structure for Expo projects
When EAS CLI creates eas.json for an Expo project, it contains a 'build' object with three default build profiles: 'development' (with developmentClient set to true and distribution set to 'internal'), 'preview' (with distribution set to 'internal'), and 'production' (empty object). This is the default configuration structure.
Git commit requirement in eas.json configuration
If cli.requireCommit is set to true in eas.json, you will be prompted to commit all changes made by EAS CLI during configuration. You can review the changes before committing and either specify a git commit message or use a default message.
Default eas.json configuration structure
The default configuration generated in a new project contains three build profiles under the build key: development (with developmentClient: true and distribution: internal), preview (with distribution: internal), and production (empty object).
Development build for Android and iOS example configuration
Example of creating internal distribution build for Android and a simulator build for iOS using custom build config:
```json
{
"build": {
"developmentBuild": {
"distribution": "internal",
"android": {
"config": "development-build-android.yml"
},
"ios": {
"simulator": true,
"config": "development-build-ios.yml"
}
}
}
}
```
Production build for Google Play Store and App Store example configuration
Example of creating a Google Play Store build for Android and an Apple App Store build for iOS:
```json
{
"build": {
"productionBuild": {
"android": {
"config": "production-build-android.yml"
},
"ios": {
"config": "production-build-ios.yml"
}
}
}
}
```