Phase 5: Testing, CI/CD & App Store

EAS Build & Submit for Expo projects

Intermediate ~3 min read
Think of it this way A friendly analogy. Read this if the technical version feels dense. Show Hide

Imagine you have a cool idea for a toy, like a magnificent spaceship made of LEGOs. You have all the separate bricks and the instructions for putting it together. Your computer program, or "app," is a lot like that: a bunch of instructions and pieces of code. To play with your spaceship, you need to put all those bricks together perfectly. This can be tricky – you need a big space, the right tools, and careful building. That’s where EAS Build comes in. EAS stands for Expo Application Services. Think of EAS Build as a super-smart LEGO factory. You send your app's code and your building plans to this factory. It has all the right machines and skilled workers to assemble your spaceship perfectly, ensuring every piece goes in the right place. It can even build different versions, like a practice spaceship to test, or a shiny final version ready for display.

Once your amazing LEGO spaceship is built, you'll want to share it! You might put it in a huge toy store so everyone can see it and take it home. Getting your toy into a big store, like "Galaxy Toys" (for Android phones) or "Apple Adventure Store" (for iPhones), isn't simple. These stores have rules, specific shelves, and paperwork to display your toy correctly and help customers find it. That's where EAS Submit comes in. It's like a reliable delivery service for your finished LEGO spaceship. Once the EAS Build factory has created your toy, EAS Submit picks it up. This service knows all the rules for "Galaxy Toys" and "Apple Adventure Store." It handles the paperwork, ensures your spaceship has the right labels and descriptions, and delivers it securely. It takes care of all those fiddly steps for you.

So, instead of spending hours building your app on your own computer, you send it to the EAS Build factory. It builds your app for you in the cloud – which means on powerful computers Expo manages. Then, you just tell EAS Submit to deliver it to the app stores, rather than figuring out all those steps yourself. This means you can focus on the fun part: inventing new features, making your app look amazing, and coming up with exciting ideas! You can quickly get your creations ready for people to use on their phones and tablets, without getting bogged down in the complicated parts of building and submitting. You get to be the brilliant designer, while EAS handles all the tricky manufacturing and delivery.

EAS Build is Expo's powerful cloud-based service designed to simplify the generation of native app binaries (APKs, AABs for Android; IPAs for iOS) from your Expo project. Rather than requiring you to set up complex native build environments on your local machine, EAS Build offloads this process to Expo's servers. This ensures consistent, reproducible builds regardless of your local setup, dramatically reducing environment-related headaches. It's a significant upgrade from the legacy expo build service, offering more control, faster build times, and deeper integration with native features. You define build profiles (e.g., development, preview, production) in an eas.json file, specifying configurations like node versions, build types, and environment variables.

Complementing EAS Build, EAS Submit automates the often tedious and error-prone process of uploading your built native app binaries to the respective app stores. For Android, this means pushing AABs to the Google Play Console; for iOS, it involves submitting IPAs to Apple's App Store Connect. EAS Submit handles the intricacies of authentication, versioning, and metadata, using credentials you've securely configured with Expo. This automation is a critical component of a robust mobile CI/CD pipeline, as it eliminates the manual steps that typically follow a successful build, saving developers significant time and reducing the chance of human error during releases.

Together, EAS Build and EAS Submit form a powerful duo for streamlining the deployment workflow of Expo projects. They integrate seamlessly into CI/CD systems, allowing you to define a pipeline where code changes trigger an automated build, followed by an automated submission to internal test tracks or the public app stores. This hands-off approach ensures that your app can be released quickly and reliably. By abstracting away the complexities of native environments and store submission processes, EAS empowers mobile developers to focus more on app development and less on infrastructure management, accelerating release cycles and enhancing overall productivity.

Key Takeaways

  • EAS Build is a cloud service for generating native app binaries (APK, AAB, IPA) without local native dev environments.
  • EAS Submit automates the upload of these binaries to Google Play Store and Apple App Store Connect.
  • They streamline mobile CI/CD by providing consistent builds and hands-off deployments for Expo projects.
  • Configurations are managed via eas.json for build profiles and secure credentials for submissions.
  • Significantly reduces manual effort and potential errors in the release process.

Code Example

bash
# 1. Trigger a production build for both iOS and Android platforms, using the 'production' profile defined in eas.json
eas build --profile production --platform all

# 2. Submit the latest successful Android build to the Google Play Store (e.g., production track)
eas submit --platform android --latest --non-interactive

# 3. Submit the latest successful iOS build to Apple App Store Connect
eas submit --platform ios --latest --non-interactive

How this code works

This code automates the process of preparing and releasing a mobile application built with Expo to both the Google Play Store and Apple App Store. The first command, eas build, is responsible for creating the actual installation files for the app. By using --profile production, it instructs the Expo Application Services (EAS) to apply specific settings defined in the project's eas.json file tailored for a public release, such as secure code signing and release-specific configurations. The --platform all option ensures that this build process generates both an Android application package (APK) and an iOS application archive (IPA) in a single step, making it efficient for cross-platform projects.

Once the builds are complete, the subsequent eas submit commands handle the upload to the respective app stores. The eas submit --platform android command pushes the Android app to the Google Play Store, while eas submit --platform ios sends the iOS app to Apple App Store Connect. A key aspect here is the --latest flag. This flag tells EAS to automatically select the most recently completed successful build for each platform, which is extremely useful for continuous integration setups where specific build IDs aren't known in advance. The --non-interactive flag is also important, as it ensures the submission proceeds without requiring manual input, perfect for automated CI/CD pipelines.