<code id="wow6k"></code>
<center id="wow6k"><wbr id="wow6k"></wbr></center>
<optgroup id="wow6k"></optgroup><optgroup id="wow6k"><div id="wow6k"></div></optgroup>
<center id="wow6k"><wbr id="wow6k"></wbr></center><center id="wow6k"><wbr id="wow6k"></wbr></center><center id="wow6k"><wbr id="wow6k"></wbr></center><optgroup id="wow6k"></optgroup>
<optgroup id="wow6k"></optgroup>
<optgroup id="wow6k"><div id="wow6k"></div></optgroup>
<center id="wow6k"></center><optgroup id="wow6k"><small id="wow6k"></small></optgroup><center id="wow6k"></center>
<center id="wow6k"></center>

蒲公英文檔中心

使用 Fastlane 上傳 App 到蒲公英

Fastlane 簡介

Fastlane 是一款為 iOS 和 Android 開發者提供的自動化構建工具,它可以幫助開發者將 App 打包、簽名、測試、發布、信息整理、提交 App Store 等工作完整的連接起來,實現完全自動化的工作流,如果使用得當,可以顯著的提高開發者的開發效率。

為了讓使用 Fastlane 的用戶,可以將 Fastlane 的自動化工作流與蒲公英結合起來,我們為大家提供了 Fastlane 的蒲公英插件。該插件使用起來非常簡單,安裝該插件后,由 Fastlane 打包生成的 App 可以自動上傳到蒲公英。

前置條件

  1. 開發者使用的是 mac 或 linux 系統
  2. 已經安裝好 ruby、rubygems、bundler
  3. 已經安裝了 Fastlane。如果沒有安裝,請參考:官方安裝指南
  4. 開發者了解基本的 App 開發流程、終端的使用方法
  5. 本文使用環境為:macOS 10.13, Xcode 9.2, Fastlane 2.78.0, fastlane-plugin-pgyer 0.2.1

安裝蒲公英的 Fastlane 插件

在終端中,輸入以下命令,即可安裝蒲公英的 fastlane 插件。

fastlane add_plugin pgyer

稍等幾秒鐘,如果出現類似下面的信息,就說明安裝成功了:

fastlane

在 Fastlane 啟動蒲公英插件

在使用 Fastlane 之前,我們首先需要在項目中初始化 Fastlane。首先進入 App 的開發目錄,執行以下命令來初始化 Fastlane:

fastlane init

執行上述命令后,Fastlane 會自動在 App 目錄中生成 fastlane 目錄,其中就會有 Fastlane 的配置文件 fastlane/Fastfile,這里,我們用 vim 打開:

vim ./fastlane/Fastfile

然后,我們找到我們在用的工作流(action),在 build_app 指令后,加入蒲公英插件的配置信息。例如:

lane :beta do
  build_app(export_method: "ad-hoc")
  pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141")
end

注意:

  1. 以上的 api_key 請開發者在自己賬號下的 應用管理 - App概述 - API 中可以找到,并替換到以上相應的位置。
  2. 在 Xcode 8.3 和 Xcode 8.3 以后的版本中,對于 build_appexport_method 的值,需要根據開發者的打包類型進行設置,可選的值有:app-storead-hocdevelopmententerprise。對于 Xcode 8.3 以下的版本,則不需要設置 export_method

打包并自動上傳 App 到蒲公英

經過以上配置后,就可以使用 Fastlane 來打包 App,并自動上傳到蒲公英了。在終端下,定位到項目所在目錄,輸入以下命令即可:

fastlane beta

在成功的情況下,可以看到類似下面的信息:

fastlane

進階用法

您也可以設置 App 上傳到蒲公英時,設置密碼:

lane :beta do
  build_app(export_method: "ad-hoc")
  pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", password: "123456", install_type: "2")
end

設置一個版本更新時的描述信息:

lane :beta do
  build_app(export_method: "ad-hoc")
  pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", update_description: "update by fastlane")
end

錯誤排查

  1. 出現錯誤時,首先請升級到最新版本的 Fastlane、Xcode、和 fastlane-plugin-pgyer 插件,然后進行重新嘗試;
  2. 如果是 Fastlane 本身的問題,可以嘗試卸載 Fastlane 后,重新安裝。
久久99久久精品免观看吃奶