Edit this page
Learn about the process of creating a production build for Android and automating the release process.
In this chapter, we'll create our example app's production version and submit it to the Google Play Store. We'll also explore how to automate the creation and release of new app versions.
To publish and distribute an app on the Google Play Store, we need:
production
build profile is present in your eas.json, which is added by default.A production Android build has a .aab format which is optimized for distribution on the Google Play Store. Unlike .apk builds, .aab files can only be distributed and installed through the Google Play Store.
1
To create an Android production build using the default production
profile, open your terminal and execute the following command. Since production
is set as the default profile in the EAS configuration, there is no need to specify it explicitly with the --profile
flag.
-
eas build --platform android
The above command will queue the build. Notice in the Expo dashboard that the Version Code is auto-incremented.
2
3
After the app is created on Google Play Console, it redirects us to the app's Dashboard screen. We need to prepare an internal test version of our app.
4
After EAS has created a production build:
5
Under Track Summary, we see that the latest release shows a temporary app name. This is because our app is not reviewed yet.
Under Releases, we see that the app is available to internal testers. To share the app with a team of testers:
Tip: To publish an app on the Play Store, in the Google Dashboard, finish the steps under Set up your app. These steps are required before releasing the app on the Play Store for the first time. You'll have to provide details like a link to a privacy policy, a target audience, data safety and so on.
Complete app store listing: To prepare the app for store listing, see Create app store assets on how to create screenshots and previews.
6
From now on, we can use EAS Submit to automate releases and avoid the manual process. To do that, we need to add the service account key to our project's eas.json.
After following the Google Service Account guide steps, we can use the downloaded JSON key:
7
Let's add the path to the Google Service Account file path in eas.json.
submit.production
profile, add android.serviceAccountKeyPath
and the relative file path as its value:{
%%placeholder-start%%... %%placeholder-end%%
"submit": {
"production": {
"android": {
"serviceAccountKeyPath": "./service-account-file.json",
"track": "internal"
}
}
}
}
In the above snippet, we're also adding track
property and setting its value to internal
. This will enable the eas submit
command to upload our production build and release it for internal testing on the Google Play Store.
eas submit
command to release a new internal testing version:-
eas submit --platform android
8
To release the app for production:
track
to production
in eas.json:{
%%placeholder-start%%... %%placeholder-end%%
"submit": {
"production": {
"android": {
"serviceAccountKeyPath": "./service-account-file.json",
"track": "production"
}
}
}
}
eas submit
command to release to the Play Store:-
eas submit -platform android
9
For subsequent releases in future, we can streamline the process by combining build creation and Play Store submission into a single step by using the --auto-submit
flag with eas build
:
-
eas build --platform android --auto-submit
Chapter 8: Create a production build for Android
We successfully created a production-ready Android build, discussed manual and automated uploading to Google Play Store using eas submit
, and automated the release process with the --auto-submit
.
In the next chapter, learn about the process of creating a production build for iOS.