RN热更新之Pushy—iOS
官方文档
快速入门-准备工作
快速入门-添加热更新功能
快速入门-发布应用
个人总结
初步接触pushy有很多不懂得,但官方文档很给力,简单易懂。
不过还是遇到了一些问题:
文档一:快速入门-准备工作
问题:Info.plist添加内容后报错
解决方法:传送门
安装连接步骤:
$ npm i -g react-native-update-cli npm WARN deprecated fs-promise@0.4.1: Use mz or fs-extra^3.0 with Promise Support /usr/local/zjdm/pushy -> /usr/local/lib/node_modules/react-native-update-cli/lib/cli.js + react-native-update-cli@0.1.0 updated 1 package in 1.882s $ npm i react-native-update@5.x npm WARN deprecated fs-promise@0.4.1: Use mz or fs-extra^3.0 with Promise Support + react-native-update@5.1.2 updated 1 package in 7.996s $ react-native link react-native-update Scanning folders for symlinks in /Users/zjdmgpo/ReactNative/测试/热更新测试/caipiaozixun/node_modules (17ms) rnpm-install info Platform ‘ios’ module react-native-update is already linked rnpm-install info Platform ‘android’ module react-native-update is already linked zjdmg:caipiaozixun zjdmgpo$
文档二:快速入门-添加热更新功能没有问题
?
文档三:快速入门-发布应用
步骤:
如果按照文档二的代码写的,在首次在pushy上发布应用前,真机调试显示如下:
初次发布应用
以供后续版本对比使用
$ pushy uploadIpa xxxxxx.ipa Uploading [===========================================================================] 100% 0.0s Ipa uploaded: 20983
?
此步完成后Pushy官网显示:
真机调试提示如下:
发布新的热更新版本
修改代码后,打包新的版本,替换原来根目录下的ipa包
$ pushy bundle –platform ios Bundling with React Native version: ?0.56.0 Scanning folders for symlinks in /Users/—-/ReactNative/_test/_Hot-update/xxxxxx/node_modules (15ms) Loading dependency graph, done. Loading dependency graph…bundle: Writing bundle output to: /Users/—-/ReactNative/_test/_Hot-update/xxxxxx/build/intermedia/ios/index.bundlejs bundle: Done 香港vps writing bundle output bundle: Copying 7 asset files bundle: Done copying assets Packing Bundled saved to: build/output/ios.1534491946584.ppk Would you like to publish it?(Y/N) Y Uploading [========================================================] 100% 0.0s Enter version name: 1.0.2 Enter description: 1.0.2 Enter meta info: {“ok”:1} Version published: 41837 Would you like to zjdmd packages to this version?(Y/N) Y 21019) 1.0.1(normal) (newest) ? Total 1 packages. Enter packageId: 21019 Ok. zjdmg:caipiaozixun zjdmgpo$
?
此步完成后Pushy官网显示:
真机调试结果如下:
点击客户端的刷新按钮,即可看到有更新版本的提示
参考文档:飞鱼湾–React Native热更新(iOS)-Pushy