react-native: El capitan: No such file or directory

Since upgrading to El Capitan, I cannot connect to the react packager when using a local IP (e.g. 192.168.178.26), however it’s working with “localhost”. Please note: It’s only not working when using an iOS 9.0 simulator. The 8.x simulators are working quite fine. Not working:

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

Working:

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

I get the following redbox: simulator screen shot 01 10 2015 13 31 17

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

If you’re always running the simulator on localhost and only need the IP for devices, you can try this in AppDelegate:

#if TARGET_IPHONE_SIMULATOR

// point to localhost here

#else

// point to fixed IP

#endif