12

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 2

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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.
2

Fire up the server with:

$ npm start

Build/run the app in the ios simulator:

$ react-native run-ios

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.