【问题标题】:fastlane match regenerates iOS development profile, but does not include M1 macsfastlane match 重新生成 iOS 开发配置文件,但不包括 M1 macs
【发布时间】:2022-11-13 12:02:06
【问题描述】:

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

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

我找到了this post(已关闭)

【问题讨论】:

    标签: fastlane fastlane-match


    【解决方案1】:

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

    首先你需要找到 fastlane 的安装位置。对我 (macOS) 来说,它安装在这里:~/.gem/gems/fastlane-2.206.2。您可能在项目文件夹$projectRoot/vendor/bundle/ruby/2.6.0/gems/fastlane-2.206.2 中安装了 fastlane。

    接下来,您将在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 时,您都需要重复此修改。

    【讨论】:

      【解决方案2】:

      Fastlane 2.211.0 应该通过新参数include_mac_in_profiles 支持此功能。

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

      修改的代码有点改动,这里就是现在需要修改的地方。

      打开文件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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-04-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-02
        • 1970-01-01
        • 2019-08-03
        • 2021-10-10
        相关资源
        最近更新 更多