Publishing and Deployment (EAS)
# CHAPTER 29
Publishing and Deployment (EAS)
1. Introduction
You have spent weeks writing perfect React Native code. You test it using the Expo Go app on your phone, and everything works flawlessly. But you cannot tell your customers to download "Expo Go" and scan a QR code to use your product. You need a standalone file—an APK/AAB for the Google Play Store, and an IPA for the Apple App Store. Historically, compiling these binaries required owning a Mac, installing massive Xcode environments, and wrestling with Android Studio configurations. In this chapter, we will master Publishing and Deployment. We will utilize Expo Application Services (EAS), the revolutionary cloud-compilation system that builds production-ready app binaries entirely in the cloud, even from a Windows machine.2. Learning Objectives
By the end of this chapter, you will be able to:- Understand the difference between Expo Go and a standalone binary.
-
Configure
app.jsonfor production (Icons, Splash Screens, Bundle IDs).
- Install and configure the EAS CLI.
- Execute an Android cloud build to generate an APK/AAB.
- Execute an iOS cloud build to generate an IPA.
3. Preparing app.json (The Blueprint)
Before building, you must define the identity of your app.
Open your app.json file. This tells the compilation engine how to brand the application.
4. What is EAS Build?
EAS (Expo Application Services) is a cloud platform. Instead of your laptop trying to compile C++ and Swift code, the EAS command zips up your JavaScript project, uploads it to a massive server farm in the cloud, compiles it using professional Mac servers, and provides you with a download link to your finished.apk or .ipa file.
5. Installing the EAS CLI
Open your terminal and install the EAS command-line tool globally on your computer.Once installed, log into your Expo account:
6. Configuring the Project for EAS
Run the initialization command inside your project folder:This generates an eas.json file. This file contains the "profiles" (recipes) for your builds.
To build an Android .apk file that you can install directly on a phone without going through the Play Store, add a preview profile:
7. Building for Android
To generate an installable Android APK, run:- EAS will upload your code.
- It will automatically generate a secure Android Keystore (cryptographic signature) for you.
- You will be given a URL to watch the build progress.
-
Wait 10-15 minutes. When it finishes, download the
.apkfile and drag it onto your Android phone to install your standalone app!
8. Building for iOS (Apple App Store)
*(Note: To build an iOS app, Apple requires you to pay the $99/year Apple Developer Fee. EAS cannot bypass Apple's legal requirements).*To generate an iOS IPA file:
- EAS will prompt you to log into your Apple Developer Account.
- It will automatically manage all the horrific certificates, provisioning profiles, and push notification keys.
-
Wait 15-20 minutes. Download the
.ipafile, or instruct EAS to submit it directly to TestFlight!
9. Visual Learning: The EAS Architecture
10. Common Mistakes
-
Ignoring Bundle Identifiers: If you do not change the
ios.bundleIdentifierorandroid.packageinapp.jsonbefore building, Expo will generate a random one for you. If you later upload an update to the App Store with a *different* identifier, Apple and Google will reject it, claiming it is a completely different app. Set your bundle identifier (e.g.,com.yourname.appname) ONCE and never touch it again.
11. Best Practices
-
Over-The-Air (OTA) Updates: What if you publish your app, users download it, and you realize there is a typo on the home screen? You do NOT need to run a new EAS build and wait for Apple to review it! Because React Native runs JavaScript, you can use EAS Update (
eas update) to instantly beam the new JavaScript code directly to users' phones over the internet, instantly fixing the typo!
12. Practice Exercises
- 1. What critical JSON file must be edited to define the application's visual App Icon and Splash Screen before executing a cloud build?
- 2. What EAS command line instruction is used to initiate the compilation process for an Android device?
13. MCQs with Answers
Why is Expo Application Services (EAS) considered revolutionary for developers working on Windows machines?
When configuring an Android preview build in the eas.json file, setting "buildType": "apk" generates a file that can be directly installed on an Android device via a USB cable or download link. If you omit this line and run a standard production build, what type of file does EAS generate by default, which is strictly required for Google Play Store submission?
14. Interview Questions
- Q: Explain the mechanical difference between running an application within the "Expo Go" sandbox versus compiling a standalone native binary via EAS.
-
Q: Detail the purpose of the
bundleIdentifier(iOS) andpackagename (Android) in theapp.jsonconfiguration. What are the severe consequences of changing this identifier after the application has been published to the stores?
- Q: Describe the mechanism of Over-The-Air (OTA) updates utilizing EAS Update. How does the architecture of React Native (a JavaScript bridge) technically allow code to be updated without compiling a new binary or passing through App Store review?
15. FAQs
Q: My app size is 50MB after building! Why is it so big compared to a native app? A: A standalone React Native app must bundle the entire React engine and JavaScript core inside the binary to ensure it runs independently. This adds about 20MB-30MB of base weight. For modern phones with 128GB of storage, this footprint is completely negligible.16. Summary
In Chapter 29, we crossed the finish line from development to deployment. We abandoned the safety of the development sandbox and defined our production identity within theapp.json blueprint, configuring icons, splash screens, and strict bundle identifiers. We installed the powerful EAS CLI and leveraged the Expo Cloud architecture to compile complex native C++/Swift/Java source code into deployable APK and IPA binaries, completing the lifecycle of a professional mobile application.