ReactNative打离线包流程(iOS)

1、生成bundle 在项目根目录中执行命令命令:

mkdir ./ios/bundle
react-native bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle
2、将bundle以文件形式添加到Xcode打开的项目中(用Add Files to “项目”)
3、更改AppDelegate.m中的资源地址(jsCodeLocation)代码:
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"bundle/index.ios" withExtension:@"jsbundle"];
4、使用Xcode按iOS一般流程打包。

猜你喜欢

转载自blog.csdn.net/u011439689/article/details/70256788