Try   HackMD

React Native 建立 iOS IPA

tags: React Native Tutorial

iOS 專案在 Archive 的時候會自動將 main.jsbundle 加入到 ipa 中。

但可以手動產出 main.jsbundle。

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

使用 Xcode 開啟專案( ios/~.xcworkspace),執行 Archive 會自動產生 main.jsbundle 於 IPA 中。

使用 Xcode 開啟專案( ios/~.xcworkspace),如果是用 RUN ,會啟動 Metro Server,若未執行 Metro Server 則會看到以下錯誤訊息。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

react-native bundle
platform ios dev false // 哪個裝置 iOS/android
entry-file index.js // iOS/android 入口的 js 名稱
bundle-output ./ios/main.jsbundle // 生成 jsbundle 的名稱
assets-dest ./ios // 圖片資源生成的路徑