【React Native】iOS离线打包

本文详细介绍了如何使用React Native的`react-native bundle`命令进行iOS离线打包,包括设置入口文件、平台选择、配置参数如bundle-output和assets-dest,以及打包后在Xcode中进行的修改,如更新Appdelegate.m文件和处理assets文件夹。在完成这些步骤后,需确保Build Phases中已添加main.jsbundle到Copy Bundle Resources,以避免运行时错误。
摘要由CSDN通过智能技术生成

我们可以用React Native提供的命令:react-native bundle
Options:
**–entry-file Path to the root JS file, either absolute or relative to JS root [required]
–platform Either “ios” or “android”
–transformer Specify a custom transformer to be used (absolute path) [default: “/Users/babytree-mbp13/projects/xcodeProjects/AwesomeProject/node_modules/react-native/packager/transformer.js”]
–dev If false, warnings are disabled and the bundle is minified [default: true]
–prepack If true, the output bundle will use the Prepack format. [default: false]
–bridge-config File name of a a JSON export of __fbBatchedBridgeConfig. Used by Prepack. Ex. ./bridgeconfig.json
–bundle-output File name where to store the resulting bundle, ex. /tmp/groups.bundle [required]
–bundle-encoding Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值