A few days ago, when I build and run my react native app from Xcode on a device, I realised that even if I set my scheme to Debug, the app is still loading from a pre-bundle
For those who are connected to the same Wi-Fi, but to a different IP address than localhost (you've set it up in RCTWebSocketExecutor.m):
Check Xcode debug console, if you can find the following error:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
Use the following answer: https://stackoverflow.com/a/32704702/3979621
And then use Codesingh's answer. BTW I recommend using the #ifdef DEBUG directive as follows, so that you don't have to change it manually when switching between build variants:
.
#ifdef DEBUG
jsCodeLocation = [NSURL URLWithString:@"http://xxx.xxx.xxx.xxx:8081/index.ios.bundle?platform=ios&dev=true"];
#else
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#endif