Create a Development Build that runs on Android Emulator or Device.
This build can be used for local development on Android. You can use the same apk (the build artifact) on both an Emulator (that you can install via Android Studio) or on a real android device.
๐ Expo Website
๐ Docs
๐ Android Studio
[00:00] At this point, you should already have the expert dev client installed. If not, you can install it now with yarn add expert dev client. You should also have an expert account. If not, head over to expert.dev and create one. You should also have the EIS CLI installed globally. Check that you do with eis dash dash [00:19] version. If you don't, you can install it with npm install dashgeascli. You should also be logged in to EIS with your expo account. Type e I s who am I to check. And if you're not logged in, you can use EIS login to sign in. If you already followed the iOS lessons, you will have an EIS JSON [00:39] in your project directory. If not, we can create one now with either EAS init or EAS build configure. And we'll choose Android and we're ready to go. This is what my EAS JSON looks like. If you haven't followed the iOS lesson, you won't have this development simulator [00:59] here but we can safely ignore it anyway because it is irrelevant for Android builds. For a development build, that is a build that we can use for local development, we'll use the development build profile. This has development client set to true, meaning that we can update the JavaScript bundle locally. And it has the distribution set to internal. That is as opposed to [01:21] external which is to the play store. Open your terminal and type EAS build profile development platform Android. As this is our first time building an Android app, we're gonna have to choose an Android application ID. With React Native apps, it is common to use the same application ID for your iOS and Android [01:41] apps. Android builds are signed using a key store that the EAS CLI can generate automatically for you from your local machine. Since this is our first build, we're asked if we want this key store to be created. Let's say yes. Now our app is building on EIS. We can head over to the website to follow along. [02:02] Now that the build is ready, we can either download the build apk or click the install button which will give you access to a QR code to scan on it on your device. Or if you have an Android emulator installed you can press y to automatically install it on there. This just runs a native code and because we set our [02:22] development client to true we'll have to start the development client. Let's type npx expostart devclient. Now for a refresh we should have our JavaScript bundle available locally. The same build will also work on a real device. So if I open my camera [02:42] app, click the install button and scan the QR code, We'll be taken to a page where I can hit install which will download the APK and install the app. You might get this prompt warning you that this app was installed from the Internet. This is meant to help prevent people from installing malicious apps. In our [03:01] case, we can hit install anyway. And open. To sync up to the dev server, let's go back to the terminal. You can either scan the QR code or you can enter the URL manually which is 100178081. [03:28] And we'll hit connect. And we're done. We can use the same development build to run on an emulator as well as a real device.
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
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!