Guide to Building React Native Apps with Expo

Aug 21, 2024

Building React Native Applications with Expo

Overview

  • Building React Native applications with Expo is easy but can be confusing.
  • Tutorial led by Simon Beck covering various methods to build React Native apps with Expo.

Getting Started with Expo Go

  1. Initial Setup:
    • Run command: npx Expo and follow with start or directly npx Expo.
    • Result: QR code for scanning on Android/iOS devices, or options to open Android/iOS simulator or web.
    • Example command: npx Expo start or npx Expo.
  2. Using Expo Go:
    • Launch Expo Go on your device to preview the application.
    • Live reload feature available.
    • Debugging: Control + Command + Z (Mac) or different shortcuts for Android to access debugging view.
  3. Limitations of Expo Go:
    • Only supports SDKs bundled with Expo Go.
    • Limited to one version of Expo SDK since 50/51.
    • May face issues with unsupported native modules.

Pre-Building Your App with Expo

  1. What is Expo Pre-Build?
    • Pre-build creates a native project with specified configurations from app.json.
    • Command: npx Expo pre-build.
    • Generates native folders for Android/iOS.
  2. Running Your Application:
    • Use command: npx Expo run iOS or npx Expo run Android.
    • The development build runs independently of Expo Go.
    • Application can be deployed to connected devices or simulators.
  3. Development Build vs. Expo Go:
    • Development builds provide more flexibility, allowing installation of native modules.
    • Live reloading and debugging support in development builds.
    • Installing Expo dev client allows use of the default React Native debugging menu.

Using Native Development Tools

  1. Accessing Xcode/Android Studio:
    • After pre-building, native folders can be opened in Xcode/Android Studio.
    • Ensure Metro server is running (npx Expo start) when building through Xcode/Android Studio.
  2. Building for Release:
    • Adjust build configuration in Xcode from Debug to Release for final builds.
    • Archive builds for App Store submission.
    • Use configuration in app.json to maintain custom settings across pre-builds.
  3. Android Studio Integration:
    • Change build variant to Release in Android Studio for APK/bundle generation.
    • Commands: npx Expo run Android with --variant release.

EAS (Expo Application Services)

  1. Introduction to EAS:
    • EAS offers hosted services for building app binaries for Expo/React Native projects.
    • Simplifies the build process, especially for iOS on Windows.
  2. Getting Started with EAS:
    • Install EAS CLI and log in with an account.
    • Run EAS build:configure to set up the project for EAS.
  3. Building with EAS:
    • Use EAS commands to build for iOS/Android, specifying profiles and platforms.
    • Can build locally or in the cloud depending on the project needs.
  4. Managing Devices and Certificates:
    • EAS simplifies device management and certificate handling for iOS builds.
    • Supports adding devices via QR codes for easier provisioning.

Resources

  • Suggested course by KD Kreman on building and deploying React Native apps with Expo EAS.
  • More resources available through Galaxy.dev for additional guidance and community support.

Conclusion

  • Expo Go is great for quick setups, while pre-builds and native tool support provide full flexibility.
  • EAS can significantly streamline the building and deployment process, especially for frequent updates.
  • Encouragement to explore more resources and community support for deeper understanding.