Source:  Twitter logo

Run the react-native bundle command in terminal from the root directory of your app

What is the root directory of my app? I am trying to run UIExplorer (on my device) from the official repo but its always giving me this message when I run

react-native bundle

Command bundle unrecognized.Did you mean to run this inside a react-native project?

I think I tried pretty much every directory inside /react-native-master

You don't need to run react-native bundle.

You should follow the 'OPTION 2' instruction in AppDelegate.m, you will find something like the screenshots below:

The instruction in the React-native website is not so clear, a clearer instructions will be:

  • Open iOS/AppDelegate.m
  • Comment out jsCodeLocation = [NSURL
    URLWithString:@"http://localhost:8081/index.ios.bundle"];
  • Uncomment jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  • Run the curl given in 'OPTION 2' (e.g. http://localhost:8081/index.ios.bundle -o main.jsbundle)
  • if this fails add the --ipv4 flag to the end of it.
  • In XCode, right click on your project directory and click Add Files to "Project Name Here" - choose the main.jsbundle file that
    you generated.

Referenced from: https://github.com/facebook/react-native/issues/240

If you still can't run it, check your main.jsbundle if it contains error. If it does, make sure the given curl path is correct. I end up changing the curl to curl http://localhost:8081/Examples/UIExplorer/UIExplorerApp.ios.bundle -o main.jsbundle in order for it to work.

4 users liked answer #0dislike answer #04
Indra Adam profile pic
Indra Adam

open cmd go project dir and run git bash show Command bundle unrecognized. bat cmd does not show an error

0 users liked answer #1dislike answer #10
Shivam Goswami profile pic
Shivam Goswami

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).