How to get rid of the “Loading from pre-bundled fi

2020-05-24 05:36发布

After the launchscreen, but before app is loaded, there's a "Loading from pre-bundled file" message that appears at the top of the screen for just a few hundred milliseconds. I don't mind this in development but I still see this message while running on my phone. Here's how I created the bundle. Any ideas? Thanks.

react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output App/main.jsbundle --resetCache

2条回答
可以哭但决不认输i
2楼-- · 2020-05-24 05:53

Change Build Configuration to release

To disable the developer menu and therefore your mentioned message, you should change your Build Configuration to Release.

For iOS open your project in Xcode and select Product → Scheme → Edit Scheme... (or press ⌘ + <). Next, select Run from the menu on the left and change the Build Configuration to Release.

查看更多
爷、活的狠高调
3楼-- · 2020-05-24 06:05

Also you can run this

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

And then change in xcode class AppDelegate.m

 //jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
查看更多
登录 后发表回答