lane :allTargets do |options|
scheme_name = options[:scheme]
increment_version_number_in_plist(
version_number: '1.0.0',
scheme: scheme_name
)
increment_build_number_in_plist(
build_number: 1
)
version = get_version_number(xcodeproj: ENV['XCODEPROJ_NAME'], target: scheme_name)
output_name = "#{scheme_name}-V#{version}.ipa"
build_ios_app(
scheme: scheme_name,
export_method: 'ad-hoc',
output_directory: "./build",
output_name: output_name,
export_options: {
provisioningProfiles: {
"target的bundleid" => "provisioning profile",
"target的bundleid" => "provisioning profile",
"target的bundleid" => "provisioning profile",
}
}
)
end
複製代碼
下邊寫好每一個target的調用ios
lane :Target1 do
allTargets(scheme: 'Target1')
end
lane :Target2 do
allTargets(scheme: 'Target2')
end
lane :Target3 do
allTargets(scheme: 'Target3')
end
複製代碼
下邊是正式調用的方法git
lane :allTargets do
allTargets(scheme: 'Target1')
allTargets(scheme: 'Target2')
allTargets(scheme: 'Target3')
end
複製代碼
在命令行中執行fastlane allTargets,後邊就是命令行裏一直在執行打包的命令xcode
大約過了50分鐘,全部包打完了,共30個ipa,平均一個ipa耗時2.5分鐘,若是是手動打包......我想沒有人願意用xcode去一次一次的點擊archivebash