π² Building and Publishing an Expo Android App
Note
The legacy
expo build:androidcommand has been retired. The recommended way to build Android applications is by using Expo Application Services (EAS Build).
Prerequisitesβ
Before you begin, ensure you have:
- Node.js installed
- An Expo project
- An Expo account
- A Google Play Developer account (for publishing)
1. Install the EAS CLIβ
Install the EAS CLI globally:
npm install -g eas-cli
Or use it without installing globally:
npx eas-cli --version
2. Log in to Your Expo Accountβ
Authenticate with your Expo account:
eas login
If you don't have an account yet:
eas register
3. Configure Your Projectβ
From your project root, initialize EAS Build:
eas build:configure
This command creates an eas.json configuration file.
4. Configure eas.jsonβ
A typical configuration looks like this:
{
"build": {
"preview": {
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {
"autoIncrement": true
}
}
}
Build Profilesβ
| Profile | Purpose | Output |
|---|---|---|
preview | Internal testing | APK |
production | Google Play release | AAB |
5. Build an APK (Testing)β
Generate an APK for internal testing:
eas build --platform android --profile preview
What happens?β
- The build runs on Expo's cloud servers.
- Once completed, Expo provides a download link for your APK.
- Install the APK directly on Android devices for testing.
6. Build an Android App Bundle (Play Store)β
Google Play requires an Android App Bundle (.aab) for app submissions.
Build the production bundle:
eas build --platform android --profile production
After the build finishes, you'll receive a download link for the generated .aab file.
Publishing to Google Play
To publish your application:
- Sign in to the Google Play Console.
- Create a new application.
- Complete all required app information.
- Upload the generated
.aabfile. - Submit the release for review.
Note
A Google Play Developer account requires a one-time registration fee.
Development vs Distribution
| Command / File | Purpose |
|---|---|
npx expo start | Runs the app locally using Expo Go or a Development Build |
| APK | Installable Android package for testing |
| AAB | Android App Bundle used for publishing to Google Play |
Verify Your Expo SDK Version
Before creating production builds, verify your Expo SDK version.
For example:
{
"expo": "~57.0.4"
}
If your SDK version is outdated or unsupported, EAS Build may fail or produce unexpected issues.
You can check your Expo SDK with:
npx expo --version
Or inspect your project's package.json.
Recommended Workflow
Develop App
β
βΌ
npx expo start
β
βΌ
Test Features
β
βΌ
eas build --platform android --profile preview
β
βΌ
Install APK on Device
β
βΌ
eas build --platform android --profile production
β
βΌ
Download .aab
β
βΌ
Upload to Google Play Console
β
βΌ
Publish π
Common Commands
Install EAS CLIβ
npm install -g eas-cli
Log inβ
eas login
Configure EASβ
eas build:configure
Build APKβ
eas build --platform android --profile preview
Build AABβ
eas build --platform android --profile production
Start Development Serverβ
npx expo start
Summary
- Use EAS Build for all Android builds.
- Use the preview profile to generate APKs for testing.
- Use the production profile to generate an AAB for Google Play.
- Configure your project with
eas build:configure. - Verify your Expo SDK is supported before creating production builds.
- Publish the generated
.aabthrough the Google Play Console.
Following this workflow ensures your Expo application is built using the current recommended approach for Android development and distribution.