安装Fastlane
sudo gem install fastlane
这一步遇到的问题-----Operation not permitted - /usr/bin***---
解决方法
sudo gem update -n /usr/local/bin --system
查看版本有没有安装成功
fastlane --version
安装 fir-cli
gem install fir-cli
这一步遇到的问题解决方法
sudo gem install -n /usr/local/bin fir-cli --no-ri --no-rdoc
初始化 Fastlane
进入到项目目录
fastlane init
编辑Fastfile文件
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.46.1"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
cocoapods
end
desc "开始打包-内测版--开发证书 - dev"
#内测版--开发证书
lane :dev do
#开始打包
puts "开始打包-内测版--开发证书 - dev"
gym(
export_method:"development",
output_directory:"./fastlane/build",# 打包后的 ipa 文件存放的目录
)
end
desc "开始打包 -- 企业公测版--hoc"
lane :hoc do
gym(
export_method:"enterprise",
output_directory:"./fastlane/build",
)
#使用fir-cli上传ipa
sh "fir publish ./build/appname.ipa -T 150f3918a1968308a147d7883b3a3"
end
end
在终端输入以下命令运行lane,格式是“fastlane + platform + lane”
fastlane ios dev
fastlane ios hoc