Day 33 打包-ios (部分)

昨天说的是 Android 今天我们来聊聊如何打包 ios,

但因为没有开发帐号,所以就只说 react native 的部份,

jsbundle

iosandroid 不太一样的是,

ios 要先把我们的 js 这块打包成 jsbundle

指令如下:

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

相关参数:

  • entry-file : 程序进入点的档案,就是 index.js
  • platform : 平台 ios
  • dev: 设 false 会对档案进行优化
  • bundle-output: 输出位置
  • assets-dest: 打包资源档

这串指令的意思是说:

进入档是 index.js ,输出档案到 ios/bundle ,命名为 main.jsbundle, 最後把资源档打包到 ios/bundle

大概 4 这样

成功後可以在指定资料夹上看到 main.jsbundle

之後转移阵地去 xcode

汇入 jsbundle

xcode 版本 : 12.0

进入 xcode , 选择专案时,请选择 /ios/*.xcodeproj

https://ithelp.ithome.com.tw/upload/images/20211019/20112878fJe0cnZVNn.png

打开後如上

在黄色资料夹上案右键, 选择 Add files to "project"

https://ithelp.ithome.com.tw/upload/images/20211019/20112878jemBrKWibg.png

再来会看到以下画面,

https://ithelp.ithome.com.tw/upload/images/20211019/20112878bRIbbJhu33.png

这时选择 options

进入到选择档案的画面,

https://ithelp.ithome.com.tw/upload/images/20211019/20112878l8B9spsG56.png

确定选择 ios/bundle 资料夹,

最後加入後的画面

https://ithelp.ithome.com.tw/upload/images/20211019/20112878NjkLrscyGk.png

react native 的部份就到这边结束,再来就是 ios 的打包环节了,不过由於我没开发帐号,只能做到这里了....

哪天有钱买个帐号来试看看吧XDDD


<<:  用 Python 畅玩 Line bot - 15:Flex Message(二)

>>:  Day34 - Windows 提权(5)-WinPEAS

正视自己的缺点

今天要分享的是发生在我大三下学期的故事,因为考量到家中的开销,我在大学四年都有 Part-time ...

【Day6】重设密码页面X Firebase Auth

中秋节快乐!!! 这几天烤肉烤到有点忘记打Code的感觉了,那提到忘记这个词,我们就想到我们平常密...

[Day 09] 用HttpClientFactory实践WebAPI服务 - 升级永丰API至.Net Core

如果有从永丰银行API那边下载过C#版的丰收款QPay.SampleCode,应该能发现他们目前的专...

Rust-定义Closure(闭包)

一般来说Rust如果要排序数组会这样写 let mut arr = [10, 5, 9, 7, 6]...

【程序】陷入低潮 转生成恶役菜鸟工程师避免 Bad End 的 30 件事 - 23

https://youtu.be/vpwC347cXog 陷入低潮 了解低潮 专注在可控的短期 充...