读完需要
3
分钟
速读仅需 2 分钟
❝
Jorge
组内前端开发小哥哥(C位),在小程序、Vue开发方向上积累了丰富经验。另外对拼团、助力等营销活动有自己独特的见解。写得了一手好代码,炒得了一桌子好菜。 ❞
参考 03.iOS证书配置流程
mark
mark
mark
2.1 使用RubyGems安装fastlane
$ sudo gem install fastlane -NV
2.2 安装完以后初始化
$ fastlane init
注意:如果有卡顿关闭当前进程然后在项目根目录下执行
$ bundle update fastlane
2.3 利用fastlane 打包app
a. 编译dev环境的包 fastlane ios dev
b. 编译uat环境的包 fastlane ios uat
c. 编译生产环境的包 fastlane ios pord_adhoc
d. 编译上架苹果商店的包 fastlane ios pord_store
mark
注意:如果遇到安装报错
(1)先安装brew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果你等待一段时间之后遇到下面提示,就说明无法访问官方脚本地址:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation
使用以下脚本
$ /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
如果中途遇到问题 :
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
解决办法:
中断进程 执行以下操作:
$ cd "$(brew --repo)/Library/Taps/"
$ mkdir homebrew
$ cd homebrew
$ git clone git://mirrors.ustc.edu.cn/homebrew-core.git
如果是cask 同样也有安装失败或者卡住的问题,解决方法也是一样:
$ cd "$(brew --repo)/Library/Taps/"
$ cd homebrew
$ git clone https://mirrors.ustc.edu.cn/homebrew-cask.git
成功执行之后继续执行前文的安装命令:
$ /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
最后看到Installation successful!如下提示就说明安装成功了。
(2)安装ImageMagick 或者 GraphicsMagick
$ brew install graphicsmagick
2.4 利用 build.sh 脚本打包
根目录下执行
a. 编译dev环境的包 ./build.sh dev
b. 编译uat环境的包 ./build.sh uat
c. 编译生产环境的包 ./build.sh pord_adhoc
d. 编译上架苹果商店的包 ./build.sh pord_store
mark
mark
mark
mark
可以到手机测试了