Building and publishing with EAS
Expo Go is fine for development, but users need a real app with its own icon, a file to install. EAS (Expo Application Services) is Expo's cloud service that builds such files on its servers. You do not need a Mac with Xcode or Android Studio for it.
Preparation
Install the EAS command-line tool and log in to a free Expo account (created on expo.dev):
npm install -g eas-cli
eas login
eas build:configureThe last command links the project to your account and creates an eas.json file with build profiles in the root.
Build profiles
{
"build": {
"development": { "developmentClient": true, "distribution": "internal" },
"preview": { "distribution": "internal", "android": { "buildType": "apk" } },
"production": { "autoIncrement": true }
}
}| Profile | What it is for |
|---|---|
development | Your own version of Expo Go with your native modules |
preview | Installing on testers' phones, an APK file for Android |
production | A file to submit to the store |
Add the "buildType": "apk" line to preview yourself: an APK file can be installed on Android directly.
The first build
eas build --platform android --profile previewThe code is sent to Expo servers, and the build takes 10 to 20 minutes. At the end the terminal shows a link and a QR code. Open it on an Android phone, download and install the app: "Blog" appears on the home screen with your icon and splash screen. For iOS, builds can be installed on devices only with a paid Apple Developer account.
Publishing to the stores
eas build --platform all --profile production
eas submit --platform android
eas submit --platform iosThe first command builds files for both stores, and eas submit sends them to Google Play and the App Store. You need developer accounts: Google Play has a one-time $25 fee, the Apple Developer Program costs $99 a year. Then the app goes through store review.
Updates without the store
If only JavaScript code has changed, a new version can be delivered without another review, through EAS Update:
npx expo install expo-updates
eas update:configure
eas update --channel production --message "Fixed the post list"The eas update:configure command connects updates to the project; rebuild the app once after it. From then on, the app downloads the updated code by itself on the next launch. Changes to app.json and new native modules cannot be delivered this way; they need a new build.
Common mistake
Adding a library with native code that is not in Expo Go and running it in Expo Go. The app crashes with an error saying the native module cannot be found. For such libraries, make a development build with eas build --profile development and run the project in it instead of Expo Go.