2015-10-01 51 views
1

如何在模拟器上运行生产模式下的反应本机应用程序?我想出如何产生的精缩束...如何为模拟器构建react-native minified“prod”应用程序?

$ react-native bundle --minify 
Building package... 
transforming [========================================] 100% 302/302 
Build complete 
Successfully saved bundle to ios/main.jsbundle 

...但我不知道如何ios/main.jsbundle加载到模拟器。

回答

1

我在下面使用。 Xcode是从非iOS/main.jsbundle加载,但iOS/PROJ/main.jsbundle ..它可能只是我的情况,因为我已经升级了react-native版本几次。

$ react-native bundle --out iOS/MyProj/main.jsbundle --minify 

关于产品,请使用?dev=false。还要确保构建为“发布”计划。

// AppDelegate.m 
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?dev=false"]; 
相关问题