簡體   English   中英

如何使用 fastlane 為您的開發團隊自動生成配置文件以運行 macOS 應用程序?

[英]How to automatize the provisioning profile generation with fastlane for your development team for running macos apps?

我需要設置我團隊的計算機來運行使用 Flutter 制作的 macOS 應用程序,為此我讀到我需要證書和配置文件,並且fastlane match是處理這種痛苦的理想工具。 問題是即使在正確運行命令后也會出現此錯誤:

錯誤:配置文件“匹配開發 your.company.reverse.domain macos”不包括簽名證書“Apple Development:Your Company Team (ABC1N23WN4)”。 (在項目“Runner”的目標“Runner”中)

我的技術負責人說,發生這種情況是因為生成證書時我的計算機沒有(或沒有)在我們的 Apple 帳戶中注冊,所以為了自動化每個團隊成員的注冊(以及之后的證書重建),我需要編寫一個用於注冊我隊友的 Mac 和重建配置文件的腳本。 我怎樣才能做到這一點?

使用以下內容創建一個快速文件:

default_platform(:ios)

platform :ios do
  desc "Set up your computer for running the macos app"
  lane :install do
    name = "#{`whoami`.chop}'s Mac (#{`hostname`.chop})"
    uuid = `ioreg -d2 -c IOPlatformExpertDevice | awk -F\\" '/IOPlatformUUID/{print $(NF-1)}'`
    register_device(
      name: name,
      udid: uuid.chop,
      platform: "mac"
    )
    match
  end
end

這樣,您只需在 macos 目錄中運行fastlane install即可將新設備添加到您的 Apple 帳戶。

注意:確保您有一個配置良好的匹配文件,如下所示,以使匹配正常工作(或在通道中定義其他參數):

storage_mode("git")

platform("macos")

# recreate the certificates if a new device was effectively added
force_for_new_devices(true)
# recreates everytime. Not a sin to use it but with force_for_new_devices it's not needed
# force(true)

# solves a lot of issues and is cheap
include_all_certificates(true)

# it will only work with development in certain circumstances
type("development") 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM