fastlane 匹配重新生成 iOS 开发配置文件,但不包括 M1 macs

问题描述 投票:0回答:2

我正在使用 match 来处理 iOS 应用程序的证书/配置文件。我们的 iOS 应用程序可以在 M1 Mac 上运行(专为 iPad 设计,而不是 Catalyst。)。匹配会重新生成配置文件,并且包含所有新的 iOS 设备,但排除 Mac 设备,尽管将“允许 Mac 设备”开关设置为打开状态。我没有看到 Fastlane Match 的任何标志或参数提及任何有关包含 Mac 的内容。有人能解决这个问题吗?

match(
  type: "development",
  git_url: ...,
  app_identifier: ..., 
  api_key: ...,
  verbose: true
  force: true
)

我发现这篇文章(已关闭)

更新(2024 年 2 月 9 日):发布 Fastlane 现已支持的后续内容。我成功地使用了 2.219.0 版本,尽管我无法与早期版本交谈。

fastlane fastlane-match
2个回答
2
投票

如果您愿意在本地修改 fastlane 叹息的一行代码,我找到了一个解决方法。

首先你需要找到fastlane的安装位置。对于我(macOS)来说,它安装在此处:

~/.gem/gems/fastlane-2.206.2
。您的项目文件夹中可能安装了 fastlane
$projectRoot/vendor/bundle/ruby/2.6.0/gems/fastlane-2.206.2

接下来您将在

sigh
工具中修改文件。使用文本编辑器打开文件:
vim ~/.gem/gems/fastlane-2.206.2/sigh/lib/sigh/runner.rb

搜索

device_classes = 
。对我来说,这是在第 272 行附近:

  device_classes = case Sigh.config[:platform].to_s
                   when 'ios'
                     [
                       Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPOD
                     ]
                   when 'tvos'
                     [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
                   when 'macos', 'catalyst'
                     [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
                   end

when 'ios'
的情况下,我们将添加一行:
Spaceship::ConnectAPI::Device::DeviceClass::MAC
。它看起来像这样:

  device_classes = case Sigh.config[:platform].to_s
                   when 'ios'
                     [
                       Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
                       Spaceship::ConnectAPI::Device::DeviceClass::IPOD,
                       Spaceship::ConnectAPI::Device::DeviceClass::MAC
                     ]
                   when 'tvos'
                     [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
                   when 'macos', 'catalyst'
                     [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
                   end

保存并退出。

重新运行 fastlane match 以像平常一样重新生成证书。 在developer.apple.com 上检查您的新配置文件。进入编辑模式,向下滚动到设备列表,查看它是否包含所有 iOS 和 macOS 设备。

最后一件事如果您仍然遇到问题。 (仍在编辑您的配置文件)确保选中“包括 mac 设备”开关。

我不确定这是否真的有帮助,因为匹配会重新生成配置文件,但我想我会提到它。也许你们中的一个人可以回复并给出答案。

请注意,每次安装 fastlane 更新时,您都需要重复此修改。


1
投票

Fastlane 2.211.0 应该通过新参数

include_mac_in_profiles
支持此功能。这是拉取请求的链接 (#20676)

我发现这对我不起作用。我包含了这个参数,并重新生成了我的开发配置文件,但 Apple Silicon mac 不包含在内。然后我回去修改上面列出的 fastlane,这确实有效。

我也尝试将两个 ENV 变量设置为

true
,但没有运气。

要修改的代码发生了一些变化,所以现在需要修改的是这里。

打开文件

sigh/lib/sigh/runner.rb
并找到这个:

if Sigh.config[:platform].to_s == 'ios' && Sigh.config[:include_mac_in_profiles]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC]
end

修改它以包含

MAC

if Sigh.config[:platform].to_s == 'ios' && Sigh.config[:include_mac_in_profiles]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC]
    device_classes += [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
end
© www.soinside.com 2019 - 2024. All rights reserved.