1. 程式人生 > >fastlane iOS 自動化打包

fastlane iOS 自動化打包

1 cd 專案根目錄

fastlane init
複製程式碼

2 選擇自定義 3 配置檔案

# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
# # https://docs.fastlane.tools/plugins/available-plugins # # Uncomment the line if you want fastlane to automatically update itself # update_fastlane default_platform(:ios) #targets = ['ElbC', 'ElbT', 'ElbF'] targets = ['ElbALL', 'ElbC', 'ElbC online', 'ElbF', 'ElbF online', 'ElbT', 'ElbT online'
] ALL_DIR = Time.now.strftime("%Y-%m-%d %H:%M:%S") platform :ios do desc "ElbT 測試版本" lane :ElbT do gym(scheme:"ElbT", export_method:"enterprise", output_directory:"~/Desktop/App/ElbT/",#檔案路徑 output_name:"ElbT--#{ALL_DIR}.ipa" ) end lane :all do targets.each do
|t| gym(scheme:t, export_method:"enterprise", output_directory:"~/Desktop/App/All/#{ALL_DIR}/",#檔案路徑 output_name:"#{t}--#{ALL_DIR}.ipa" ) end end end 複製程式碼

4 執行 終端切換至專案下的fastlane

目錄預覽
4.1 檔案介紹 Appfile內部是個人開發者賬號的配置 Fastfile 定義的是一個個的lane,執行不同的打包操作

操作例項 單個打包 ElbT fastlane ElbT

一鍵打包所有 fastlane all

5 打包過程

終端執行過程截圖
打包成功
部分打包結果截圖
6 結束
結果彙總