Fastlane常用命令
- fastlane init
1.在当前项目根目录使用
fastlane init
命令初始化项目
2.然后再项目更目录能看见fastlane文件夹,配置里面Fastfile
文件
我的Fastfile配置文件:
根据需求我配置
ad-hoc
和Release
两种打包方式
default_platform(:ios)
platform :ios do
desc "打包版本"
lane :adhoc_build do |options|
puts "开始打包"
gym(
clean:true,
scheme:"XXXX",
configuration:"Release",
export_method:"ad-hoc",
output_directory:"输出路径",
)
puts "开始上传蒲公英"
pgyer(
api_key: "xxxxxxxxxxxxxxxxxxx",
user_key: "xxxxxxxxxxxxxxxxxx",
update_description: "update by fastlane"
)
end
lane :app_store_build do |options|
gym(
clean:true,
scheme:"xxxxxx",
configuration:"Release",
export_method:"app-store",
output_directory:"输出路径",
)
#上传AppStore
deliver
end
end
- fastlane fastlane add_plugin pgyer
如果需要打包到蒲公英需要在初始化的时候执行
fastlane fastlane add_plugin pgyer
命令并配置蒲公英
pgyer(
api_key: "xxxxxxxxxxxxxxxxxxx",
user_key: "xxxxxxxxxxxxxxxxxx",
update_description: "update by fastlane"
)
- fastlane adhoc_build
根据需求选择不同的方式来打包:
fastlane adhoc_build
打adhoc包
app_store_build
打包到商店
网友评论