Create a build to run on your physical iPhone device that can also be used for local development.
π Further reading: Push Notifications Docs
[00:00] We want to create an app built that we can run on our physical phone and also use for development. From the e I s JSON, we see that's the development build is exactly what we're after. It's marked as internal so as opposed to distributing on the App Store and we also have development client true. [00:20] This would let us update the JavaScript bundle on the fly which is needed for local development. From the previous lesson, we know that this build needs the distribution certificate and the ad hoc provisioning profile. Now open your terminal and type in e s build profile development and platform iOS. This [00:40] will now prompt you to log in to your Apple account. If you haven't set up your certificates yet or if there are changes in your app that require the certificates to be updated or recreated, the ERC applier will tell you about it now and prompt you to update. As we're using the ad hoc provisioning profile, this build will only be able to be [01:00] installed by devices that are registered and included in the profile. So every time you do a build, you get prompted to check whether you want to add additional devices. I already have everything to set up so I'm happy to reuse the profile. When you use the expo CLI to create your app, it defaults to the push notification capability to be enabled. In order to [01:19] actually send push notifications, you need to set up some push notification certificates. I'm going to skip this for now, but I'll add a link to the documentation for further reading. If your project has the push notification capability, we don't have push notification set up, the CLI will actually ask you every time. So if you say no now, you'll get prompted again the next time you [01:39] build. Now we need to wait for the build to finish. We can click the link here to follow along on the expo website. Before opening the build on your device, if you're running iOS 16 or later and you haven't turned on developer mode yet, you'll need to enable it now. Otherwise, iOS will prompt you with an alert saying the [01:59] development mode is required. You can follow the instructions on this documentation page on how to enable development mode. But essentially you need to open the settings, go to privacy, select developer mode and toggle it on. You'll also have to restart your device in order for this to take effect. And after your phone restarts, you should get this alert [02:19] prompting you whether you're happy to turn on development mode. Now after your build's finished, you should see this QR code in your terminal that you can scan to install it on your phone. Or if you open your build page, you can click install which shows you the same QR code or you can download the build or you can [02:39] also open it with Expo Orbit. Look out for a future lesson a bit more details on orbit. I'm going to click install here. We want to open a camera app, scan the QR code, and install the app. Now I can open my app on my phone. And you can see I've got the right app [02:59] name and app icon. But I haven't yet started my development server. So let's go back to the terminal and type in npx expostart devclient. I'm just going to open the camera app again and scan this QR code. It will allow to access the local network, and we're done. We now have [03:19] our own iPhone app running on a physical 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!