默認(rèn)已安裝Xcode;
安裝fastlane
sudo gem install fastlane --verbose
-
安裝完成
成功
使用命令查看安裝的版本號(hào):
fastlane --version
配置項(xiàng)目
- 進(jìn)入到工程目錄下,執(zhí)行
fastlane init
酗电,生成Appfile
和Fastfile
文件
fastlane init
- 配置
Appfile
app_identifier("com.xxxx.xxx") //項(xiàng)目bundleID
apple_id("xxx@qq.com") //郵箱
team_id "xxx" //證書team ID
- 配置
Fastfile
涡相,以蒲公英為例埋哟;
platform :iOS do
desc "Push a new release build to the pgyer"
# ----------------------- 打包內(nèi)測(cè).ipa文件 -----------------------
lane :pgyerUp do
puts "*************| 開始打包.ipa到蒲公英... |*************"
# 更新項(xiàng)目build號(hào)
#updateProjectBuildNumber
# 開始打包
gym(
# 項(xiàng)目信息
output_name:"xxx.ipa",
scheme:"xxx",
workspace: "xxx.xcworkspace",
# 是否清空以前的編譯信息 true:是
clean:true,
# 指定打包方式痰憎,Release 或者 Debug
configuration:"Release",
# 指定輸出文件夾 xxx.ipa
output_directory:"/Users/xxx/Documents/demo",
# Xcode9將不會(huì)允許你訪問鑰匙串里的內(nèi)容芜抒,除非設(shè)置allowProvisioningUpdates
export_xcargs:"-allowProvisioningUpdates",
# 隱藏沒有必要的信息
silent:true,
# 指定打包方式罚勾,目前支持app-store, package, ad-hoc, enterprise, development
# 注:由于使用手動(dòng)配置證書毅人,在export_options指定打包方式
export_method:"development",
# 手動(dòng)配置證書,注意打包方式需在export_options內(nèi)使用method設(shè)置,不可使用export_method
# export_options: {
# method:"development",
# provisioningProfiles: {
# # "boundleId":"描述文件名稱"
# "com.xxxx.xxxx":"development_profile"
# },
# signingStyle: "manual"
# }
)
puts "*************| 開始上傳蒲公英... |*************"
# 蒲公英的key
pgyer(api_key: "xxx", user_key:"xxx")
puts "*************| 上傳蒲公英成功?? |*************"
end
end
蒲公英
在工程目錄下
- 安裝蒲公英插件
fastlane add_plugin pgyer
第一次安裝提示選擇3
[16:17:00]: Seems like the plugin is not available on RubyGems, what do you want to do?
1. Git URL
2. Local Path
3. RubyGems.org ('fastlane-plugin-pgyer' seems to not be available there)
4. Other Gem Server
? 3
成功
安裝成功
- 打包上傳到蒲公英
fastlane pgyerUp
發(fā)布成功