Create Production ready App for App Store and Play Store with Expo EAS Build

ByRipplez

From our previous post we talked about how to create a native app with our pre built next.js website, so today i will be giving you a guide that you can use to create a production ready build with EAS that you can upload to the app store or play store.
EAS Build is your personal app-building factory in the cloud! It takes your Expo or React Native project and transforms it into a production ready app, ready to to be published on the App Store or Play Store. EAS Build streamlines the entire process by offering pre-configured settings that work perfectly with these frameworks. No more getting worried about complex configurations or app keys! EAS Build can also handle your app signing credentials for you. EAS Build's internal distribution features allows you to Share your app with teammates for testing or collaboration also.
Prerequisites
To initiate an eas build you will need to install the eas-cli on your machine. simply run this command from your terminal
npm install -g eas-cli
Additionally, you have to create an expo account https://expo.dev/signup. Sign in to the account by entering the following command in your terminal
eas login
note that if you've previously signed in to an Expo account using the Expo CLI, you won't need to sign in again.
Configure the project
You have to configure the project for both iOS and Android EAS build. To configure an Android or an iOS project for EAS Build, run the following command:
eas build:configure
Running the configuration command should provide you with an EAS configuration file (often named eas.json). This file acts will help you in customizing your EAS Build process. the eas build code should look like this:
Additional Considerations:
Additional configuration may be required for some scenarios:
⦁ Does your app code depend on environment variables? Add them to your build configuration.
⦁ Is your project inside of a monorepo? Follow these instructions.
⦁ Do you use private npm packages? Add your npm token.
⦁ Does your app depend on specific versions of tools like Node, Yarn, npm, CocoaPods, or Xcode? Specify these versions in your build configuration.
next we have to work on the app.json file. this is where we can set the name, version icon, splash image and all other configuration. i recommend that you should ensure that the name of you app starts with a capital letter, also configure the build number and version code which must match your package.json version, because EAS prevents you to submit twice the same app version, so you have to increase it manually to bypass EAS checks. The eas.json code should look like this:
Finally build your App For Production
After you have confirmed that you have a Google Play Store or Apple App Store account and decided whether or not EAS CLI should handle app signing credentials, you can proceed with the following set of commands to build for the platform's store:
eas build --platform android
eas build --platform all (This builds for both iOS and Android)
Sit back and relax while EAS Build handles the app building. The terminal will display the build progress, keeping you informed. Once complete, you will receive a link to your Expo dashboard that leads to your built app.
For play store you can download the android App Bundle (.aab file). For IOS you can also download the .ipa file. This files is what you need to upload on Google Play Console and Apple Developer Dashboard.
Looking for More?
The official EAS Build documentation is a treasure trove of information. Dive deeper for advanced configuration options and explore the full potential of EAS Build: https://github.com/expo/eas-cli.