Reconfigure your eas.json and app.json so you can install the development, preview and production builds all on the same device.
An app on your phone is uniquely identified by the bundle identifier on iOS and the package on Android, so to make the builds unique we have to make these IDs different based on the build profile.
📖 Docs
[00:00] You would have noticed that for our 3 different build profiles, development, preview, and production, installing 1 will override the others. It is common to want to have multiple app variants installed at the same time, especially production and development. An app on your phone is uniquely defined by the bundle identifier on iOS and [00:20] the package on Android. So we have to make these IDs different based on the build profile. Open your EAS JSON and an n of key to your development profile with app variant development. Then add app variant preview to the preview profile and production to the production profile. Now open your app. [00:39] Json and rename it to app config JS and export default to config object. Since this is now a JavaScript file, we can add a function for get bundle ID. We'll have access to these app variant values from process dotenv. So we'll check if the variant is production. We'll [00:59] return the app ID we use for default. And if the variant is preview, we'll change the app ID and add a dot preview at the end. And finally, as a default case, we can default to dev. Now we can call this function to get the bundle ID, and we can use this for both the iOS bundle identifier as well as the Android [01:19] package. Let's also create a function called get app name and we'll check if the app variant is production and return our app name for preview. We can add preview in the name and for dev, we can add dev in the name. And we can use this get app name function to dynamically get the app name. Now open [01:39] your terminal and run EIS build profile development, and let's rebuild both apps. Once the dev build is finished, you can also run EAS build profile preview to rebuild the preview build. After that, you'll be able to install the production preview and dev builds all on the same 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!