fastlane 自动打包
2018-11-08 本文已影响0人
hie
一、所需工具:
1、ruby :
查看ruby版本 ruby -v
2、Xcode命令行工具:
终端输入 xcode-select --install,若弹出下图,点击安装即可

二、安装
1、 安装fastlane
sudo gem install fastlane
2. 初始化,cd 到工程目录
fastlane init
会出现下面选项,

选项1:自动截图,自动截取APP中的截图,并添加手机边框;
选项2:自动发布beta版本用于TestFlight;
选项3:自动发布到AppStore;
选项4:手动设置;
直接输入选项数字,按回车即可。
3、打包配置
初始化成功,会在工程目录生成下面文件

需要自己编辑Appfile和Fastfile两个文件,
编辑Appfile:

app_identifier:App bundle id
apple_id:苹果账号
team_id:对应苹果账号id
编辑Fastfile:

lane :后面接 操作名(例如 BTCTest),打不同的包,可定义不同的 lane
workspace:App 工作区间,我的用到pod,所以是 项目名.xcworkspace
scheme:直接 项目名
export_method:打包方式(ad-hoc,app-store)
output_directory:IPA包导出路径
configuration:打包模式(Release、Debug)
4、打包
fastlane + 操作名

出现上图,则打包成功