React-Native打包发布

来源:互联网 发布:linux c代码创建目录 编辑:程序博客网 时间:2024/05/18 14:13

1.生成bundle文件

cd到工程目录下,执行命令行代码: react-native bundle --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios --assets-dest ./ios --dev false


2.ios项目,修改AppDelegate.m文件(使用main...jsbundle这句,注释掉localhost:8081.....这句):

//  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

   jsCodeLocation = [[NSBundlemainBundle]URLForResource:@"main"withExtension:@"jsbundle”];

0 0
原创粉丝点击