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.
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.
2 Comments
vbullinger
This is a great tip for running it, but what about rebuilding it? I'd rather not have to fire up XCode. Especially for a demo. I like the idea of saying "npm install -g react-native-cli" then "react-native init HelloWorld" then "react-native run -iOSSimulator" or something, you know? This exists in tons of other frameworks. Personally? I'm guessing that it's just a matter of time and Facebook will make it happen.
Colin Ramsay
You can probably use xcodebuild for that: developer.apple.com/library/ios/technotes/tn2339/_index.html#//…