new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Expo & React Native · all subjects

app versions & local builds

13 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

App version properties in app config

Three properties manage app versions in the app config file: `version` is the user-facing version visible in stores (represents `versionName` on Android in android/app/build.gradle and `CFBundleShortVersionString` on iOS in Info.plist); `android.versionCode` is the developer-facing build version for Android (represents `versionCode` in android/app/build.gradle); `ios.buildNumber` is the developer-facing build version for iOS (represents `CFBundleVersion` in Info.plist).

Application.nativeApplicationVersion and nativeBuildVersion from expo-application

Use `Application.nativeApplicationVersion` from the `expo-application` library to show the user-facing version inside your app. Use `Application.nativeBuildVersion` from the `expo-application` library to show the developer-facing build version inside your app.

User-facing version update workflow for production

When doing a production release, the user-facing version should be explicitly set and updated in the app config. Update the `version` property in app config when the production build is submitted to the app stores. This marks the beginning of a new development cycle for a new version of your app. This applies also if your project uses `expo-updates` with an automatic runtime version policy.

Remote version source is recommended as of EAS CLI 12.0.0

The `remote` version source is the recommended behavior from EAS CLI version 12.0.0 onwards. EAS servers can store and manage developer-facing build versions (`android.versionCode` and `ios.buildNumber`) remotely. To enable it, set `cli.appVersionSource` to `remote` in **eas.json**.

Configure remote version source with autoIncrement

To enable remote version source, set `cli.appVersionSource` to `remote` in eas.json. Then under the `production` build profile, set the `autoIncrement` property to `true` to automatically increment `android.versionCode` and `ios.buildNumber` on every build.

Remote version initialization from local project

The remote version is initialized with the value from the local project. For example, if `android.versionCode` is set to `1` in app config, when creating a new build using the remote version source, it will auto increment to `2`. If build versions are not set in app config, the remote version initializes with `1` when the first build is created.

Remote version source is source of truth, local app config values ignored

When the `remote` version property is enabled in eas.json, the build version values stored in app config are ignored and not updated when the version is incremented remotely. The remote version source values are set on the native project when running a build, which is considered the source of truth for these values. You can safely remove these values from your app config.

Sync existing versions to remote with eas build:version:set

To sync already-defined versions to EAS Build remotely, run `eas build:version:set` in the terminal. Select the platform when prompted, answer 'yes' to set `cli.appVersionSource` to `remote` in eas.json, then enter the last version number that you have set in the app stores when prompted. After these steps, you can set `build.production.autoIncrement` to `true` in eas.json.

Sync remote versions to local with eas build:version:sync

To build your project locally in Android Studio or Xcode using the same version stored remotely on EAS, run the command `eas build:version:sync` to update your local project with the remote versions.

Remote version source limitations

`eas build:version:sync` command on Android does not support existing React Native projects with multiple flavors. `autoIncrement` does not support the `version` option. It is not supported if you are using EAS Update with runtime policy set to `"runtimeVersion": { "policy": "nativeVersion" }`. For similar behavior, use the `"appVersion"` policy instead.

Local version source configuration

You can configure your project so the source of truth for project versions is the local project source code itself. Set `cli.appVersionSource` to `local` in eas.json. With this setup, EAS reads app version values and builds projects as they are without writing to the project. You can enable auto incrementing versions locally by setting the `autoIncrement` option on a build profile.

Local version source with existing React Native projects

In existing React Native projects using local version source, the values in native code take precedence. The libraries `expo-constants` and `expo-updates` read values from the app config file. If you rely on version values from a manifest, you should keep them in sync with native code. This is especially important if using EAS Update with runtime policy set to `"runtimeVersion": { "policy": "nativeVersion" }`, because mismatched versions may result in delivery of updates to the wrong version of an application. Use `expo-application` to read the version instead of depending on values from app config.

Local version source autoIncrement limitations

With `autoIncrement` in local version source, you need to commit your changes on every build if you want the version change to persist. This can be difficult to coordinate when building on CI. For existing React Native projects with Gradle configuration that supports multiple flavors, EAS CLI is not able to read or modify the version, so `autoIncrement` option is not supported and versions will not be listed in the build details page on expo.dev.

Give your agent this brain