fastlane iOS官方翻譯四 (生成測試包)

使用fastlane打包iOS測試版本

打包你的app

fastlane使用名叫build_app的action來打包你的app,添加如下代碼到你的Fastfile:

lane :beta do
  build_app(scheme: "MyApp")
end

你可以添加更多的參數(shù)來構(gòu)建你的app,舉例

lane :beta do
  build_app(scheme: "MyApp",
            workspace: "Example.xcworkspace",
            include_bitcode: true)
end

你可以使用下面代碼來執(zhí)行

fastlane beta

如果成功了,你可以在當(dāng)前目錄下找到一個(gè)[產(chǎn)品名稱].ipa.獲取更多相關(guān)參數(shù)可以執(zhí)行fastlane action build_app.

簽名

如果你在上一步因?yàn)楹灻鴮?dǎo)致失敗,我們準(zhǔn)備了簽名向?qū)?/a>幫助你設(shè)置你應(yīng)用的簽名.

上傳你的app

在你構(gòu)建完成你的app后.它將根據(jù)你的選擇上傳你的測試版本.fastlane的長處在于可以輕松的更換測試提供者,或者一次上傳至多處而不要更多的工作.

你所要做的只是把測試提供者的名字列舉在你的build_applane中:

lane :beta do
  sync_code_signing(type: "appstore")    # see code signing guide for more information
  build_app(scheme: "MyApp")
  upload_to_testflight
  slack(message: "Successfully distributed a new beta build")
end

fastlane會自動的將.ipa的相關(guān)信息從build_app中發(fā)送至你選擇的測試提供者.

獲取所有可用參數(shù)你可以:

fastlane action slack

Beta測試提供者

  • TestFlight
    你可以使用fastlane輕松的上傳測試包到testflight上.只需要添加testflightaction在打包完成后
lane :beta do
  # ...
  build_app
  upload_to_testflight
end

一些例子

lane :beta do
  # ...
  build_app

  # Variant 1: Provide a changelog to your build
  upload_to_testflight(changelog: "Add rocket emoji")

  # Variant 2: Skip the "Waiting for processing" of the binary
  #   While this will speed up your build, it will not distribute
  #   the binary to your tests, nor set a changelog
  upload_to_testflight(skip_waiting_for_build_processing: true)
end

如果你使用fastlane init 設(shè)置fastlane,你的appID存儲在fastlane/Appfile中.你也可以重寫用戶名使用upload_to_testflight(username: "bot@fastlane.tools").

獲取可用參數(shù)你可以

fastlane action upload_to_testflight

你也可以使用fastlane自動管理你的測試者.

  • Crashlytics
lane :beta do
  # ...
  build_app
  crashlytics(api_token: "[insert_key_here]",
              build_secret: "[insert_key_here]")
end

你可以通過組織設(shè)置頁面獲取你的API key 和secret links.

獲取更多可用參數(shù)

fastlane action crashlytics
  • HockeyApp
lane :beta do
  # ...
  build_app
  hockey(api_token: "[insert_key_here]")
end

可以在API Tokens賬戶設(shè)置獲取你的API token.

發(fā)布標(biāo)注

  • 根據(jù)git commits自動生成

你可以更改日志,這樣就不需要太多的語句存儲在Fastfile中.

lane :beta do
  sync_code_signing
  build_app

  changelog_from_git_commits # this will generate the changelog based on your last commits
  upload_to_testflight
end

更多的例子:

changelog_from_git_commits(
  between: ['7b092b3', 'HEAD'], # Optional, lets you specify a revision/tag range between which to collect commit info
  merge_commit_filtering: exclude_merges # Optional, lets you filter out merge commits
)
  • 根據(jù)日志生成
    你也可以根據(jù)日志自動生成標(biāo)注
lane :beta do
  # Variant 1: Ask for a one line input
  changelog = prompt(text: "Changelog: ")

  # Variant 2: Ask for a multi-line input
  #   The user confirms their input by typing `END` and Enter
  changelog = prompt(
    text: "Changelog: ",
    multi_line_end_keyword: "END"
  )

  sync_code_signing
  build_app

  upload_to_testflight(changelog: changelog)
end

[http://www.itdecent.cn/p/2a029dda5337](fastlane iOS官方翻譯五 (生成正式包))

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • fastlane運(yùn)行所需要的環(huán)境: OS X 10.9以上 Ruby 2.0 以上 Xcode 擁有一個(gè)開發(fā)者賬號...
    阿姣_0405閱讀 3,248評論 0 4
  • 一、FastLane介紹 1.1 FastLane是什么? FastLane是一種配置iOS和Android自動化...
    IT越越閱讀 1,315評論 0 2
  • 距離上次寫iOS 中使用Jenkins進(jìn)行持續(xù)集成有一段時(shí)間了。毋庸置疑,Jenkins對我們打包的幫助還是很大的...
    有涯逐無涯閱讀 734評論 0 1
  • 毋庸置疑,Jenkins對我們打包的幫助還是很大的——被測試的同學(xué)追著要IPA包的日子終于一去不復(fù)返了。但作為追求...
    iOS逆向開發(fā)閱讀 1,667評論 2 10
  • 我們在日常開發(fā)中經(jīng)常會遇到如下問題 團(tuán)隊(duì)成員一不小心Revoke了證書導(dǎo)致所有的開發(fā)小伙伴需要重新下載證書 每次提...
    DreamMmMmM閱讀 1,018評論 0 5

友情鏈接更多精彩內(nèi)容