gym概述:
Gym Features | |
---|---|
?? | gym 編譯速度高于其他命令30% |
?? | 更好的輸出 |
?? | 幫助解決內(nèi)部錯誤,如:簽名問題 |
?? | 靈活的默認值: 自動檢測project、scheme |
?? | 很好配合其他插件 |
?? | 自動生成.ipa和DYSM文件 |
?? | 簡單, just gym |
?? | 簡單和動態(tài)配置使用參數(shù)和環(huán)境變量 |
?? | 存儲共同配置在“Gymfile” |
?? | 所有的archives被存儲,并且Xcode Organizer可訪問 |
?? | 支持所有iOS 、 Mac applications |
使用方法:
fastlane gym
fastlane gym --workspace "Example.xcworkspace" --scheme "AppName" --clean
注:如果需要制定Xcode編譯,添加:DEVELOPER_DIR="/Applications/Xcode6.2.app" fastlane gym
gym使用詳情查看:
fastlane action gym
App Store 或者 TestFlight:
fastlane gym --export_method ad-hoc
添加相關(guān)參數(shù):
fastlane gym --include_bitcode true --include_symbols false
可在Gymfile文件配置相關(guān)參數(shù):
export_options(
method: "ad-hoc",
manifest: {
appURL: "https://example.com/My App.ipa",
},
thinning: "<thin-for-all-variants>"
)
選擇手動匹配證書:
export_options(
method: "app-store",
provisioningProfiles: {
"com.example.bundleid" => "Provisioning Profile Name",
"com.example.bundleid2" => "Provisioning Profile Name 2"
}
)
Note: 如果選擇了match就不需要配置相關(guān)的證書和描述文件,自從Xcode8之后基本使用自動匹配證書,所以不再詳細講手動匹配。
栗子:
desc "Submit a new adhoc Beta Build to https://www.pgyer.com/"
lane :adhoc do
#清除上一次的ipa文件
clean_ipafile
match(git_url: certificates_git_url,
type: "adhoc",
app_identifier: app_bundle_identifiers,
readonly: true,
)
gym(scheme: app_scheme,
workspace: app_workspace,
include_bitcode: true,
configuration: "Release",
export_method: "ad-hoc",
output_directory: ipa_out_path,
output_name: ipa_out_name,
silent: false,
include_symbols: true,
)
pgyer(api_key: pgyer_api_key, user_key: pgyer_uKey)
end