Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit 5413ad2 · 15 days ago

Expo, part 5: builds in EAS — profiles, APK and AAB, signature keys, one project per app, and over-the-air updates

🌐 Machine-translated from Russian. Show original

In this part:

Installing the EAS CLI and logging in#

npm install --global eas-cli
eas login
eas whoami

You can also use it without a global installation: npx eas-cli@latest build ... — that's how you always get the latest version.

One project expo.dev per app#

Our most expensive mistake at the start: building the app in the wrong project expo.dev. The project stores:

  • Android signature key (keystore) and iOS certificates;
  • push keys (FCM V1, APNs) — and push tokens are tied to projectId;
  • build history and version numbers;
  • EAS Update channels.

If you accidentally build Kommit Chat" in a WorkTime project, you get an APK signed with someone else's key, with someone else's push keys. The team has several apps, each with its own project: Kommit Chat" — only in ITgovChatApp, WorkTime — only in theirs.

Linking a project to an existing expo.dev project by ID (Project settings → ID):

eas init --id <ID проекта>

The command writes the extra.eas.projectId to the app.json. Our build script checks that the projectId in the app.json matches the expected one and stops if not. Tip: write the project ID in the app's README.

eas.json: profiles#

{
  "cli": { "appVersionSource": "remote" },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": { "buildType": "apk" },
      "autoIncrement": true
    },
    "production": {
      "autoIncrement": true
    }
  },
  "submit": { "production": {} }
}
ProfileWhat resultsFor whom
developmentdebug build with expo-dev-clientconnects to npx expo startdevelopers
previewrelease APK build for direct installationtesters, pilot in company
productionAAB for Google Play and IPA for the App Storestores
  • "appVersionSource": "remote" — build numbers (versionCode / buildNumber) are stored by EAS, and the autoIncrement increments them itself. No longer need to remember "what number was last time" — Google Play will not accept builds with re-versionCode.
  • You change the version the user sees ("version": "1.0.0" in app.json).

For development build, install the module:

npx expo install expo-dev-client
eas build --profile development --platform android

APK or AAB#

APKAAB (Android App Bundle)
Installingdirectly on your phoneonly through Google Play
Google Playnew apps does not accept APK formatthe mandatory
The user's sizeone file across all architecturesPlay assembles the optimal APK for the
Whentesting, internal apps, handouts from the site,publishing in the

Assembly:

eas build --platform android --profile preview      # APK для тестировщиков
eas build --platform android --profile production   # AAB для Google Play
eas build --platform ios --profile production       # IPA для App Store / TestFlight

Assembly takes 10–20 minutes in the cloud (the free plan may be on the waiting list). At the end — a link and a QR code for installation.

The APK size can be reduced by limiting processor architectures (we have only arm64-v8a and armeabi-v7a, without x86 emulators) via the expo-build-propertiesplugin.

Android Signature Key (keystore)#

During the first build, EAS will ask: "Generate a new Android Keystore?" — answer Y. The key will be saved in the EAS project.

What you need to know:

  • Every app update must be signed with the same key. Lost the key (or built it in another project) — users will not have the APK installed over the old one, so they will have to uninstall the app.
  • Play App Signing is enabled for Google Play: Google stores the app signing key, and your key from EAS becomes the "upload key." If the upload key is lost, it can be reset via Google Play support.
  • Back up keystore: eas credentials → Android → Keystore → Download. Store in the company's password vault, not in the repository.

Before assembly#

Before each assembly, we automatically start:

npx expo-doctor@latest     # совместимость версий модулей и конфигурации
npx tsc --noEmit           # ошибки типов
npm test                   # тесты чистой логики (разбор SSE, форматирование)

A cloud build that crashed after 15 minutes due to a typo in the types — lost time and a free plan limit.

Over-the-air updates: EAS Update#

EAS Update delivers new JavaScript code and images to already installed apps without a new publication in the store. Fix text, screen logic, or urgent errors in minutes.

npx expo install expo-updates
eas update:configure
eas update --channel production --message "Исправлена ошибка в списке диалогов" --environment production
  • The channel is set in the build profile in eas.json; only assemblies in that channel production receive updates.
  • The --environment flag (which EAS environment variables to use) is mandatory starting from SDK 55.
  • The update downloads in the background at launch and is applied the next time the application is launched .
  • runtimeVersion determines which builds are compatible with the update. If you added a native module, changed permissions, or plugins — you need a new build through the store, OTA won't help.

Store rules allow this to fix bugs and improve the app, but not change its purpose — significant feature changes are made through the regular moderated release.

Automatic assembly#

eas build can be run from CI (GitHub Actions, etc.) with the Expo access token in CI secrets — the variable EXPO_TOKEN. The token is created on expo.dev in the account settings, preferably for a robot account with minimal rights. More about CI — the series "Docker and CI/CD from scratch."

Assembly checklist#

  • Each application has its own expo.dev project, and the ID is recorded in the README
  • projectId in app.json is checked before assembly
  • Development / preview (APK) / production (AAB) profiles
  • appVersionSource: remote and autoIncrement
  • Keystore created in EAS, backup in password vault
  • Before assembly: expo-doctor, type checking, tests
  • EAS Update is configured for fast JS code fixes

The final step — stores: Expo, part 6: publishing to Google Play and App Store — accounts, testing, account deletion, and data forms.

Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.