3

How can I run the application without rebuilding the project (of course the app is installed on the relevant simulator from previous run)

I run the application on iOS (for instance) like this:

react-native run-ios --simulator='iPhone 8'

gran33
  • 12,421
  • 9
  • 48
  • 76

2 Answers2

4

Thanks to this post, I found this command:

xcrun simctl launch booted <APP_BUNDLE_ID>

It will launch the application which pre-installed on the current running simulator (if we have 2 or more simulators running simultaneously, we will need to pick one by its simulator ID).

gran33
  • 12,421
  • 9
  • 48
  • 76
2

Depends on what you're trying to do. If you just need to reload, then you can do it through the developer menu as @Kraylog says. Or via ⌘R if the application is already open and running.

If you've closed packager/metro bundler, then you'll want to start that with react-native start. You should then be able to just click the app icon in the simulator to run it + reloading as stated above as needed.

Michael Cheng
  • 9,644
  • 6
  • 46
  • 48
  • Thanks, I need command line tool/commnad (or part of `react-native-cli`) to run the app without build it. – gran33 Feb 02 '18 at 19:27