Intermediate React Native, v2

Building in the Cloud with EAS

Intermediate React Native, v2

Check out a free preview of the full Intermediate React Native, v2 course

The "Building in the Cloud with EAS" Lesson is part of the full, Intermediate React Native, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Kadi demonstrates how to generate iOS and Android builds using Expo Application Services (EAS). EAS is more convenient since it doesn't require the complex local tooling setup. Installable applications can be generated, signed, and distributed to testers through an array of tools and services.

Preview
Close

Transcript from the "Building in the Cloud with EAS" Lesson

[00:00:00]
>> Kadi Kraman: So this is not really like part of the course because this isn't like a course about EAS, but I wanted to just show you how that would work if. S, if you have difficulty setting up your local environment, then you can build in the cloud, and this is the workaround for it.

[00:00:25]
So EAS is Expo Application Services. So it is Expo Application Services. And it is a cloud service, like a CIT service specifically for building React Native apps. So let me show you how you would build it. So I have the EAS CLI installed locally already, globally. So if I do, yeah, so I have this installed.

[00:01:04]
So I'm going to EAS in it a new project. So this will register it on my Expo account, so I'm already logged in. And it's asking me if I want to create a new project called plantly, and I'll say yes. And now we do eas build configure. So this is asking me what platforms I want to build, so I'll just do all.

[00:01:30]
And then this creates this little eas JSON file here. And this basically sets up the three main types of build that we might want to create. So we have the development build, and this is the one that you would use for your local development. It has development client true, so it enables the dev menu so you could load the JavaScript bundle for your local machine.

[00:01:59]
And distribution internal, this basically means that this build will be directly installable on your device. The preview build is the same as the development build. The only difference is that the development client is instead the true, which basically means that you have one JavaScript bundled into your app and then that's it, so it will basically emulate what production will look like.

[00:02:24]
So if you want to test your app, your production-looking app without the dev client, that's the one you would use. And then production is a completely different file type, it has different signing credentials, it's not directly installable on a device, but it is for delivery to the App and Play Stores.

[00:02:47]
And I do have a section on build sign in later. But I will say that for iOS builds, all of the builds here require for you to have an Apple developer account, which is a subscription service where it costs $99, I think a year. And this is another thing why being able to build locally is useful.

[00:03:09]
Because if you just build locally your iOS app, you can run a simulator and you don't need a developer account. But you can also do iOS simulator true, simulator true. And this will do a simulator build for iOS. So now I do eas build, profile development platform iOS.

[00:03:51]
And you can see it didn't prompt me to log in or anything. So this is actually now building in the cloud. And it's going to run through all the various steps. And actually, I can do that, here's one I did earlier, just to show you.
>> Kadi Kraman: That it does all the steps.

[00:04:16]
And the important part is cuz you were asking whether you would do pre-build if you're building on CI. So one of the steps actually is prebuilt. So this is obviously the service is very much optimized for like React Native and Expo. And it very much supports CNG. So if your project is set up to use prebuilt it runs prebuilt.

[00:04:38]
And that's why it's also very important to not have your native directories in gitignore, because if you don't, it will use the existing directories. So that's why you can also build existing React Native apps on here. So if it does have needed directories, it will just use those.

[00:04:58]
>> Kadi Kraman: And this, if you look at how long this build took, so it took about four minutes. And I can actually just build for Android as well.
>> Kadi Kraman: So this is actually, so we're gonna talk about build signing later, but the EAS CLI handles all the credentials management for you.

[00:05:36]
So for the Android build, it needs to generate a Keystore, which is the security step for installing it on a physical device, and it's asking me if I want to generate a new Keystore, because it's the first time I'm running it, so I'll say yes. But that's how you would build the same thing on EAS.

[00:05:54]
Actually, let me show you my, here's how, here's what I did earlier. Once it's built, if it is a build that is installable on a device, you can download the APK. So that's why I was thinking about doing it cuz you were asking where the app bundle is.

[00:06:09]
So you can download the IPA or APK directly from here. You can install it via QR code, or you can send this page to someone else to install via QR code. Or we also have this tool called Expo Orbit. And it's a free tool, and it lets you install an arbitrary APK and IPA to a simulator, emulator, or a physical device.

[00:06:36]
So I think, do I have Orbit installed here cuz I do.
>> Speaker 2: Yeah, usually we will take those files and then load them into Perfecto for the QA team to test them. So part of this build, we then push the APK IPA files to the necessary directories for perfecto.

[00:06:59]
>> Kadi Kraman: Yes, that makes sense? Yeah, so Expo Orbit, it looks like this. And you can, it lists all of the simulators that I have on my mac. And actually the fun thing is if I plug in my phone, so let's plug in the Android phone.
>> Kadi Kraman: And reopen this.

[00:07:32]
It actually shows off with my Android phone as well. So you could select an APK from a local file or select built from EAS, it's quite handy. So even if you're not using EAS, it's actually quite a handy little tool for installing apps on devices, especially physical devices, which is a little bit tedious.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now