fastlane 使用
一、安装Fastlane
sudo gem install fastlane -NV或是brew cask install fastlane
二、初始化Fastlane
cd到你的项目目录执行
fastlane init
三自动管理证书
fastlane match init
git_url("https://gitee.com/xxxx/xxxxxxx.git") //新建一个项目,将地址复制到这里
type("development") # 默认match所同步的类型,可不管
app_identifier("bundle Id") #bundleId,若同工程下有多个,则用["bundleId1","bundleId2"]
username("user@fastlane.tools") #苹果开发者账号
配置好后,在主项目工程目录下执行:
fastlane match development --verbose
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :custom_lane do
# add actions here: https://docs.fastlane.tools/actions
end
lane :dis do
xcode_select("/Applications/Xcode.app")
build_app(
scheme: "Japanese",
export_method: "app-store",
output_name: "app-store.ipa",
export_xcargs: "-allowProvisioningUpdates"
)
end
lane :dev do
xcode_select("/Applications/Xcode.app")
build_app(
scheme: "Japanese",
export_method: "development",
output_name: "dev.ipa",
export_xcargs: "-allowProvisioningUpdates"
)
end
lane :hoc do
xcode_select("/Applications/Xcode.app")
build_app(
scheme: "Japanese",
export_method: "ad-hoc",
output_name: "hoc.ipa",
export_xcargs: "-allowProvisioningUpdates"
)
end
end