Android and ios emulator on mac

broken image

First, you could specify a simulator to the React Native run-ios command by setting the -simulator flag.

broken image

React Native picks the default iOS simulator, but you can switch that in two different ways. Once everything is finished, the default app is running. Leave this command window open as you're developing because it will build and rebuild the JavaScript portion of the app. As the app is launching, a new command window called the metro bundler or the packager will launch. This can take quite a while the first time you run the app, but it will be faster after the first time. The simulator will start automatically, and the app will build and launch. Then run the app in the iOS simulator with react-native run-ios. Once the app is created, CD into the new app directory. You can also change this name later before you distribute the app. Note that the app name must be alphanumeric only and can't contain spaces. We'll make an app to review restaurants.

broken image

Instructor: After installing the React Native CLI and Xcode if you're running iOS or the Android dependencies if you want to run Android, create a new React Native project by running react-native init and the name of your project.