安裝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
進(jìn)入到項(xiàng)目目錄
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 "開始打包-內(nèi)測版--開發(fā)證書 - dev"
#內(nèi)測版--開發(fā)證書
lane :dev do
#開始打包
puts "開始打包-內(nèi)測版--開發(fā)證書 - dev"
gym(
export_method:"development",
output_directory:"./fastlane/build",# 打包后的 ipa 文件存放的目錄
)
end
desc "開始打包 -- 企業(yè)公測版--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
在終端輸入以下命令運(yùn)行l(wèi)ane,格式是“fastlane + platform + lane”
fastlane ios dev
fastlane ios hoc