3

DEVOPS: Opening the simulator of your choice in Expo React Native

 1 year ago
source link: https://iwritecodesometimes.net/2022/10/19/devops-opening-the-simulator-of-your-choice-in-expo-react-native/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

DEVOPS: Opening the simulator of your choice in Expo React Native

I’ve been spending a lot of time in the terminal lately. As discussed in a previous article of mine, launching the a specific simulator while working with React Native isn’t that hard for iOS, and only take a quick edit to make happen for Android.

Recently, there’s been a buzz at my work around Expo, which I’ve championed for years as a great way to get started in React Native. While Expo has some limitations, they usually fall well-short of what most of the client’s at my work need. That’s been especially true recently as the platform matured, and more and more I find myself spending more of the lifetime of a project in the “managed” flavor of Expo, which further abstracts away the platform specifics of React Native and even adds a tidy little Web flavor to boot.

That said, sometimes I find myself needing a specific simulator on iOS and by force of habit try to start one using the --simulator flag, which is unsupported. Oops! Thankfully, it’s still super easy to launch a specific device with just two commands. First, start the metro bundler like so:

npm start

Then, key shift + I at the same time to start the simulator selection menu. You can then peruse the simulators with your arrow keys and make a selection via the enter key. It even goes as far as to install Expo Go on new simulators automatically – easy!

oct-19-2022-13-16-13.gif?w=884

Simulator picker in action

Likewise, if you need to pick a specific android Emulator, you can use the method described in my last post before running npm run android for effectively the same outcome. Check out the docs for more detail and FAQs, as well as a troubleshooting guide. Cheers!

https://docs.expo.dev/workflow/ios-simulator

Full-time developer, part-time hobby-jogger, Tsar of awful check-in comments. I like cooking, exploring Chicago, and a good story. I write code sometimes. View all posts by Joe Meyer


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK