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!

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!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s