React native app stuck on splash screen on device but works in simulator React native app stuck on splash screen on device but works in simulator xcode xcode

React native app stuck on splash screen on device but works in simulator


It seems that I have found the problem. According to https://facebook.github.io/react-native/docs/running-on-device, when you build and run the app on your device, your app will load js files from the packager on your computer, so you can live reload your app. That means your device has to be connected to your computer or has to be in the same wifi network as your computer. If your device can't access the packager, it will stuck on the splash screen and quit.

To run on your device reliably, edit build schema and build release version.


For me when I build, it was working fine in simulator however, in actual device only splash screen was coming and nothing else.

This was because my build configuration was debug mode which is default I guess, I had to change release/build configuration from debug to release and everything work as expected.

Upvote it if this helps :)

enter image description here


It should be perfectly possible to run the app in debug, on the device, without the packager attached! You have to use react-native bundle to create an offline bundle, and add it to your Xcode project. Then your app should fall back to that bundle when the packager is not available.

This used to be in the Deploying to Device FB docs, not sure why it's not there anymore.

Sample call (our index.ios.js is placed in ./dist by TypeScript):

react-native bundle --dev true --assets-dest ./ios --entry-file ./dist/index.ios.js --platform ios --bundle-output ios/main.jsbundle

Also, it's apparently necessary to tell your app to run directly from the bundle rather than try to access the development server, which seems to cause the timeout (we had the same issue as OP).

Comment out this line:

jsCodeLocation = // whatever

And add this line:

jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];