Undisclosed
August 2024

Streamlining React Native Development with EAS CLI

Comparing the efficiency of EAS CLI and local builds for React Native apps, highlighting Expo CLI's advantages in simplifying development.

Services

Efficient app development process

Platforms

Mobile

Streamlining React Native Development with EAS CLI

Project Overview

Expo greatly simplifies the process of building .apk and .ipa files for us, whether it's done locally or through their EAS cloud service.

Expo CLI streamlines the development, building, and deployment of React Native applications through a command-line interface. Offering a suite of tools and services, it abstracts much of the intricacy of native app development, enabling developers to concentrate on coding. By harnessing Expo CLI, developers can efficiently create, test, and deploy their applications, bypassing the complexities of native app development.

Approach Workflow

Contrast with Conventional React Native Application

In a conventional React Native application, developers are tasked with managing native code and dependencies. However, Expo CLI simplifies this by abstracting these complexities. This allows developers to concentrate on writing JavaScript code while Expo takes care of the native code. As a result, setting up and maintaining a React Native project becomes significantly less time-consuming and effort-intensive.

Steps for locally building .apk and .ipa files

1. Moving from Expo's Managed Workflow to Bare Workflow

  • In order to have complete control over the native code and enable local builds, you must switch from Expo's managed workflow to the bare workflow. This transition is essential for local builds. Execute:
  • This command will generate the android and iOS directories in your project, containing the native code.
    • When using the expo prebuild command for iOS, it will attempt to install the appropriate version of CocoaPods using brew or gem, and then run pod install. If any issues occur during this process, they will be addressed in the subsequent step of Building IPA Locally.

Building APK Locally

  • After the Android folder is generated, ensure to navigate inside the android/app directory and verify the presence of the debug.keystore file. You won't be able to proceed without it if it's missing.
  • Additionally, ensure to configure your Java version appropriately. In your case, if you're using JDK 17, set JAVA_HOME accordingly.
  • You can now build the APK using Android Studio.

Using Android Studio:

1. Open the android folder in Android Studio.

2. Wait for the Gradle sync to finish.

3. There needs to be a directory labeled "Gradle Scripts" situated beneath all other directories.

a. Open the file called as build.gradle (Module :app) inside the Gradle Scripts

4. Go to Build > Generate Singled Bundled or APK

  • Click on APK radio option
  • For the keystore path Choose existing and select the debug.keystore file
  • For remaining fields copy over from the signingConfigs object
  • Select the release option and Finish

5. After the build completes, you can find the APK in the android/app/release/app-release.apk folder.

Building IPA Locally

Prerequisites

  • Mac Required and a apple developer account which is paid
Steps
  • Go inside iOS folder generated by expo prebuild
  • Type the below command
  • Once this step is done go inside the ios folder
    • double click on the file extension which ends with .xcworkspace , it will open xcode
    • Wait for xcode indexing to finish
  • Select Any Any iOS Device (arm64) option beside the  appName, image attached below
  • Go to Product > Archive
    • This will start the build process.
    • You may get a signing certification issue, or Signing requires a development team error
  • Solution → Go to Signing & Capabilites and add your developer account, which will resolve the issue
  • After the build process is successfully completed, a archives screen will popup
  • Click on Distribute App
  • Select Release Testing which should generate the ipa

Steps to build apps using EAS Cloud

Prerequisites
  • An Expo account: You need to have an Expo account to use EAS Build.
  • An Expo project: This case study assumes you have an existing Expo project.
  • Node.js and npm: Ensure you have Node.js and npm installed on your machine.
Step 1: Install EAS CLI

First, you need to install the EAS CLI globally on your machine. Open your terminal and run:

Step 2: Log in to Your Expo Account

Before you can use EAS Build, you need to log in to your Expo account. Run the following command and follow the prompts:

Step 3: Configure the project

Navigate to your Expo project directory and run:

This command will guide you through the process of setting up EAS Build for your project. It will ask you to choose the platforms you want to build for (Android and/or iOS) and configure your project accordingly.

It will also create an eas.json file in the root directory with the default configuration. It looks something like this

Step 5: Build Your App

Now, you're ready to build your app. To build an APK for Android, run:

To build an IPA for iOS, run:

You can also build both platforms at once by omitting the --platform flag:

Step 6: Download Your Build

Once the build process is complete, EAS CLI will provide you with a URL to download your APK or IPA file. You can download the file directly from your browser or use the provided URL in your terminal.

Conclusion

Expo CLI offers a powerful and efficient way to develop, build, and deploy React Native applications. It simplifies the development process by abstracting away the complexities of native code management. However, for scenarios requiring custom native code or when you need full control over the build process, ejecting the project and generating local builds provides the necessary flexibility. By understanding the differences between cloud Expo builds and local builds, we can choose the most appropriate build strategy for their specific needs, whether it's for testing, distribution, or custom native code integration.

Testimonials

Don’t take our word for it.
See what our past clients say.

“Best Development Agency”

I'm impressed with the cloud and web development work done by Intuio! Their proficiency and effectiveness beyond my expectations. Strongly advised!

John Carter - Code Webflow Template
Jack C.
CEO at Accident LLC
Company Logo - Code Webflow Template

“One of the best agencies out there”

Outstanding assistance from Intuio! They have excellent cloud and mobile development services. delivered precisely and on schedule.

Will Spark - Code Webflow Template
Rahul B.
Partner at IP & Associates
Company Logo - Code Webflow Template

“True Experts in Cloud Development”

Happy with the outcome! With regard to cloud development services, Intuio excelled. dependable and competent service!

Sam Parker - Code Webflow Template
Marc D.
VP of Engineering at Stealth Startup
Company Logo - Code Webflow Template

“Best Development Agency”

Intuio's rapid POC implementation exceeded expectations, delivering quality results within the stipulated deadline. Highly recommend their expertise!

John Carter - Code Webflow Template
Thomas C.
Director at Telephony Company, USA
Company Logo - Code Webflow Template

“Best Professional Team”

I am extremely impressed Intuio's level of expertise and professionalism. Intuio is the best software consulting agency I have worked with.

Will Spark - Code Webflow Template
Will S.
Engineering at WXY
Company Logo - Code Webflow Template

“True Experts in Web Development”

When it comes to web development, Intuio is unmatched. Great experience always producing outstanding outcomes. Highly recommend Intuio !

Sam Parker - Code Webflow Template
Sam P.
VP of Engineering at Tin
Company Logo - Code Webflow Template
  Previous
Next   
Let’s get in touch

Ready to start working together with us?

 Email Icon - Code Webflow Template

Send us a message!

Don't miss out on the opportunity to take your business to new heights. Contact us now and let's embark on a journey of success together.

Contact us
Development Execution - Code Webflow Template

Browser our packages

From startups seeking a strong foundation to established enterprises aiming to optimize operations, our scalable and flexible packages cater to businesses of all sizes.

Browse packages