【问题标题】:How to handle multiple iOS targets (widgets) in fastlane如何在 fastlane 中处理多个 iOS 目标(小部件)
【发布时间】:2021-01-20 07:15:57
【问题描述】:

我正在尝试将小部件添加到我们的项目中,但 fastlane 无法再自动化了。

  • 如何在 fastlane 中编辑小部件捆绑标识符
  • 如何为正确的目标设置正确的配置文件

我需要的东西:

  • 在 xcode 中,应用目标应具有捆绑标识符 x.y.z
  • 在 xcode 中,小部件目标应具有捆绑标识符 x.y.z.widget

应用目标 小部件目标

  • 在 xcode 中,应用目标应具有配置文件匹配即席 x.y.z
  • 在 xcode 中,小部件目标应具有配置文件匹配即席 x.y.z.widget

应用目标签名 小部件目标签名

当前 Fastfile 通道:

  desc "Build the app and send it to Testflight for testing"
  lane :build_adhoc do
    UI.message("app_name: #{app_name}")
    UI.message("app_identifier: #{app_identifier}")
    UI.message("apple_id: #{apple_id}")
    UI.message("team_id: #{team_id}")
    UI.message("sku: #{sku}")

    xcodeprojpath = "../ios/" + app_name + ".xcodeproj"

    proj = Xcodeproj::Project.open("../" + xcodeprojpath)

    proj.build_configurations.each do |item|
      item.build_settings["DEVELOPMENT_TEAM"] = team_id
      item.build_settings["PROVISIONING_PROFILE_SPECIFIER"] = match_ad_hoc_provisioning
      item.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = match_ad_hoc_signing
      item.build_settings["SWIFT_VERSION"] = swift_version
      item.build_settings["ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"] = "YES"
    end

    proj.recreate_user_schemes
    proj.save

    begin
      disable_automatic_code_signing
    rescue => ex
      UI.message("failed to disable automatic signing")
      UI.error(ex)
    end
    get_certificates(
      development: false,
      username: apple_id,
      team_id: team_id,
    )
    unlock_keychain(
      password: keychainPassword,
    )

    #bumpBuildNumber

    sigh(username: apple_id, adhoc: true, readonly: false, app_identifier: app_identifier, team_id: team_id)  #force: false,
    gym(export_method: "ad-hoc",
        clean: true,
        configuration: "Release",
        codesigning_identity: match_ad_hoc_signing,
        export_team_id: team_id,
        skip_profile_detection: true,
        export_options: {
          method: "ad-hoc",
          signingStyle: "manual",
          provisioningProfiles: { "#{app_identifier}": "#{match_ad_hoc_provisioning}" },
        })
  end

【问题讨论】:

    标签: ios xcode fastlane fastlane-match fastlane-gym


    【解决方案1】:
    gym(export_method: "ad-hoc",
        clean: true,
        configuration: "Release",
        codesigning_identity: match_ad_hoc_signing,
        export_team_id: team_id,
        skip_profile_detection: true,
        export_options: {
          method: "ad-hoc",
          signingStyle: "manual",
          provisioningProfiles: { "#{app_identifier}": "#{match_ad_hoc_provisioning}" },                                                   
                                { "#{widget_identifier}": "#{match_ad_hoc_provisioning_for_widget}" }
        })
    

    您可以在 export_options->provisioningProfiles 中为小部件添加一个键,以指定小部件的配置文件。

    【讨论】:

      猜你喜欢
      • 2019-06-17
      • 1970-01-01
      • 1970-01-01
      • 2020-08-04
      • 2018-02-21
      • 1970-01-01
      • 2014-03-13
      • 2013-06-29
      • 1970-01-01
      相关资源
      最近更新 更多