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 结束
来源: https://juejin.im/post/5c1de228e51d4548ac6f5a22