美文网首页
React Native ios打包

React Native ios打包

作者: 月下丶初雨 | 来源:发表于2018-08-07 10:10 被阅读0次

1.证书的个人证书和公司证书的创建
https://www.jianshu.com/p/4ae9845bc6ac(个人)

2.在自己项目的ios文件夹下新建一个文件夹取名bundle

3.打包命令:

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

4.在Xcode的AppDelegate.m文件里 添加生产环境配置对比如下:

//    测试环境配置:模拟器
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

//生产环境配置:真机
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

5.将项目由debug状态改成release状态,Xcode-->Product-->Scheme-->Edit Scheme...

6.选择 Generic iOS Device ,修改Version和Build号

7.clean一下项目,然后编译。此处生成.ipa文件的方式有多种,可以Archice,也可以先删除.app文件再在编译,将成的.app文件拖到iTunes里面生成。有了.ipa文件,测试还是直接发布到App Stroe按自己的需求而定。

相关文章

网友评论

      本文标题:React Native ios打包

      本文链接:https://www.haomeiwen.com/subject/dskovftx.html