如何摆脱“从预先捆绑的文件加载”消息?

时间:2015-12-22 22:00:14

标签: react-native

在启动屏幕之后,但在加载应用之前,屏幕顶部会出现“从预先捆绑的文件加载”消息,只有几百毫秒。我不介意这在开发中,但我仍然在手机上运行时看到此消息。这是我创建捆绑包的方式。有任何想法吗?感谢。

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

2 个答案:

答案 0 :(得分:15)

更改构建配置以发布

disable the developer menu以及您提到的消息,您应该将Build Configuration更改为Release

  

对于iOS,在Xcode中打开您的项目并选择产品→方案→编辑方案...(或按⌘+<)。接下来,从左侧菜单中选择Run并将Build Configuration更改为Release。

答案 1 :(得分:0)

你也可以运行这个

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

然后更改xcode类AppDelegate.m

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

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