iOS Question

How to run React-Native Examples?

I can't find any instructions on how to install and run one of the other Examples provided in '' such as ''.

The tutorial only tells you to do

react-native init AwesomeProject

which grabs ''.

If I clone the entire 'react-native' repository, and then run

npm install
npm start

From the root folder (i.e. '/react-native'), and then open '/react-native/Examples/Movies/Movies.xcodeproj' in Xcode, and Run the project, it seems to build fine. The Simulator comes up, shows a "Movies" intro screen for the app, but then the red screen of death appears with a print out of:


and Terminal, where 'npm start' is running at the root folder, prints out:

Error: EISDIR, read
at Error (native)
[02:35:02] <START> request:/Examples/Movies/MoviesApp.includeRequire.runModule.bundle

Answer Source

It should work just by following the Getting Started Tutorial, except that you have to run npm install inside your react-native directory.

Then just run for example the Movie Project with Xcode.

If you want to "isolate" the MovieProject or another react-native example project, the easy way is to init a new react native app (react-native init MyAppName) and just copy the JS files from the example project (in the example below the Movie Project) into the new app folder.

And then don't forget to edit your iOS/AppDelegate.m file.

You have to edit 2 lines:

jsCodeLocation = [NSURL URLWithString:@"http:/localhost:8081/index.ios.bundle"];


jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/MoviesApp.bundle"];


RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation


RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download