In this tutorial, you’ll learn how to build, prepare, and deploy your React Native app (created with Expo) to the Google Play Store and Apple App Store. This final step will enable you to make your app available to millions of users worldwide.
What You Will Learn Today:
- Preparing your app for production
- Building the app for Android and iOS using Expo
- Deploying to the Google Play Store
- Deploying to the Apple App Store
Step 1: Preparing Your App for Production
Before deploying your app, you need to prepare it for production. This involves configuring your app’s metadata, optimizing performance, and ensuring that your app meets the guidelines of the app stores.
Update App Metadata in app.json
Expo projects use the app.json
file to store app configuration and metadata. Open your project’s app.json
and make sure to update the following fields:
{
"expo": {
"name": "MyFirstApp",
"slug": "myfirstapp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"android": {
"package": "com.myfirstapp.app",
"versionCode": 1
},
"ios": {
"bundleIdentifier": "com.myfirstapp.app",
"buildNumber": "1.0.0"
}
}
}
Key Fields:
- name: The display name of your app.
- slug: The identifier for your project (used by Expo).
- version: The version of your app (update this for each release).
- icon: The app icon (usually 512x512px).
- splash: The splash screen shown when the app launches.
- android.package: The unique package name for your app on Android.
- ios.bundleIdentifier: The unique identifier for your app on iOS.
Make sure to replace com.myfirstapp.app
with your unique identifiers for both platforms.
Step 2: Building the App Using Expo
Expo provides a simple and powerful way to build apps for both Android and iOS. Let’s build the app for each platform.
Building for Android
- Open your terminal and run the following command to build an APK for Android:
expo build:android
- Expo will prompt you to choose a build type. Select APK (if you’re deploying to the Google Play Store, you may also want to build an AAB).
- Expo will start building your APK. Once the build is complete, Expo will provide a download link to the APK file.
Building for iOS
To build your app for iOS, run the following command:
expo build:ios
Expo will prompt you to provide credentials (you will need an Apple Developer account to build iOS apps). Expo will handle the process of signing and building the app.
Once the build is complete, you’ll receive a download link to the .ipa
file.
Testing the Build (Optional)
You can test your Android APK or iOS .ipa
file by downloading the build to your device or using an emulator/simulator.
For Android:
- Download the APK and install it on an Android device for testing.
For iOS:
- You can use TestFlight (Apple’s app for testing) to distribute the
.ipa
file to testers before releasing it to the App Store.
Step 3: Deploying to the Google Play Store
Now that you’ve built your app, it’s time to deploy it to the Google Play Store.
Create a Google Play Developer Account
- Visit the Google Play Console and sign up for a developer account.
- There is a one-time registration fee of $25 to create the account.
Submit Your App to Google Play
- After creating a developer account, go to the Google Play Console and create a new app:
- Choose the language, app name, and app category.
- Fill in all required metadata fields, such as app description, icon, screenshots, and privacy policy.
- Upload the APK or AAB file:
- Go to the Release section of the Play Console and upload the APK or AAB you built earlier.
- Set App Pricing and Distribution:
- Choose whether your app is free or paid.
- Specify the countries where you want to distribute the app.
- Submit for Review:
- Once you’ve filled out all required information, submit your app for review.
- Google will review your app, and once it’s approved, it will be available on the Google Play Store.
Step 4: Deploying to the Apple App Store
To deploy your app to the Apple App Store, you need to be enrolled in the Apple Developer Program, which costs $99/year.
Create an Apple Developer Account
- Visit the Apple Developer Program website and sign up for a developer account.
- Pay the $99/year subscription fee.
Submit Your App to the App Store
- Once you’re enrolled in the Apple Developer Program, download Xcode from the Mac App Store.
- Set up App Store Connect:
- Visit App Store Connect and create a new app record.
- Fill in app details like app name, primary language, category, and pricing.
- Upload the
.ipa
file:
- Use Xcode or Transporter (an Apple tool) to upload the
.ipa
file to App Store Connect.
- Fill out the metadata:
- Provide screenshots, app icons, a description, keywords, and other required information.
- Submit for Review:
- Once all the information is provided, submit your app for review.
- Apple’s review process is usually more stringent than Google’s, and it may take a few days for the app to be approved.
Once your app is approved, it will be live on the Apple App Store.
Step 5: Testing Your App with TestFlight (Optional)
Before releasing your app to the public, it’s a good idea to test it with real users using TestFlight.
- After uploading your app to App Store Connect, you can distribute it to beta testers using TestFlight.
- Invite users via their email addresses, and they’ll receive an invitation to test your app on their devices.
- Gather feedback and fix any bugs before officially launching your app.
Step 6: Recap and Summary
Congratulations! You’ve successfully deployed your app to the Google Play Store and Apple App Store. Here’s a quick summary of what you’ve done:
- Updated the app’s metadata in the
app.json
file. - Built the app for Android (APK/AAB) and iOS (.ipa).
- Uploaded the builds to the Google Play Store and Apple App Store.
- Submitted the app for review on both platforms.
By deploying your app, you’ve made it available for millions of users to download and use. You’ve also learned how to maintain and update your app as you improve and add new features in the future.
Final Thoughts
This concludes your 10-day journey into mobile app development using React Native and Expo! You’ve learned how to:
- Set up your development environment.
- Build components, manage state, and handle user input.
- Navigate between screens and handle data fetching from APIs.
- Integrate Redux for global state management.
- Store data locally using AsyncStorage.
- Implement push notifications to engage users.
- Deploy your app to the Google Play Store and Apple App Store.
You now have the skills to build, maintain, and deploy your own mobile apps. Keep experimenting, building new features, and learning as you continue your development journey!