2015-10-01 86 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"]; 
相關問題