Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a React Native app without launching Xcode?

Can an iOS app (built entirely with React Native) be built/run from the command line? PhoneGap has a nice ios-sim utility for doing just that, but I haven't had any luck with it.

like image 606
senornestor Avatar asked Mar 27 '15 00:03

senornestor


2 Answers

If you build the project once using Xcode, then you can close it, run npm start in your project root (to start the packager), fire up the Simulator (maybe using ios-sim). Since you built it once in Xcode, the app will be installed in the simulator so you can just run it and the whole CMD+R refresh process will work.

like image 194
Colin Ramsay Avatar answered Oct 30 '22 03:10

Colin Ramsay


Fire up the server with:

$ npm start

Build/run the app in the ios simulator:

$ react-native run-ios
like image 32
Kaleb Portilho Avatar answered Oct 30 '22 05:10

Kaleb Portilho