Create a Development Build for iOS Simulator with EAS

Kadi Kraman
InstructorKadi Kraman
Share this video with your friends

Social Share Links

Send Tweet
Published a year ago
Updated 2 months ago

Create an iOS build for developing locally on a Simulator.

This is the only native iOS build you can do on EAS without having an Apple Developer account and being enrolled in the Apple Developer Program.

It can be used for local development on an iOS simulator, so you can only do this on a Mac, because you must be able to install Xcode to get access to the iOS simulators.

⚙️ Xcode

🔗 Expo Website

📝 Docs

[00:00] Ios simulators such as this one are only available on Mac OS. They get installed as part of Xcode which is Apple's IDE for building apps. So if you don't have Xcode already, you can download it from the app store. You also need an expo account in order to use EAS. So if you don't have an account yet, head over to xpo.dev and create one. [00:20] Now open your terminal and run npm install dashgeasdashgli to install the EAS CLI globally. You will use the CLI to trigger builds from your local machine. Now type e s login and log in to your Exwork account. [00:40] Now in your project directory, type esbuildcolon configure to configure your project. This is now asking if I'd like to automatically create my ES project on my expo account and I'm choosing yes. You can choose to configure both platforms at the same time but for now let's just do Ios. [01:00] The e s configure command added an e s JSON file which is the configuration file for EIS. The build key here defines the different types of builds we've set up. And in the app JSON, we scroll down, we will have an EIS project ID which [01:20] is the ID of the project on your expo account. Now if you open expo.dev under projects you should be able to see your project here. By default the EIS JSON will have a development preview and a production build configuration. Let's copy this development one [01:41] and name it development colon simulator. And let's add another key here with iOS and pass in simulator true. The simulator true here will indicate that we want to build this app for the simulator as opposed to a real [02:01] device. The internal distribution here means that they build this for distributing internally as opposed to distributing on the app or play stores. And this development line true will allow us to build the app bundle locally. Without this, the app would come pre bundled with the version of [02:20] JavaScript. We currently have it locally meaning you can't actually use it for local development. Now we are ready to create our first build. In your terminal type eas build dash dash help to see what options you need to pass in. From here, we can see we definitely wanna pass in profile because if we don't, it will default to production. [02:42] So in our eas.json, we'll know that our profile is called development simulator. So we'll do e s build dash dash profile, and we also want to pass in dash dash platform to be iOS. Since this is [03:01] our first ever Ios build EAS will ask us to choose a bundle identifier. A bundle identifier is kind of like an app ID more akin to a URL. There is a convention here to use a reverse domain name. So if you, for example, owned my website [03:21] dot com, you might want to name your app com.mywebsite.appname. The suggestion here is come my expert username and the app name, which is fine by me. The CLI will now upload your local code to EAS and trigger the build. If we go [03:41] back to our project page on expert.dev, we can even follow our build progress. Now the build is finished after about 5 minutes. And if I go back to my terminal, it is already prompting me whether I want to install it on my simulator. So let's choose yes here. [04:03] This will download the app archive and it will install it on the simulator that I have open. You can see that this build is using the app icon and the app name that I added earlier. So it is a real native Ios build. This of course is the native code only. So for local development, [04:23] we'll also need to start the development server and the dev client here is telling us exactly what to do. We need to run npx expostartdashdashdevclient. And let's press fetch development servers. And you can see that it's found local host 8081. And [04:43] voila. We have a local iOS development build in a simulator.

egghead
egghead

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today