0

我正在为客户制作 iOS 应用程序,但无权访问他们的配置文件或签名证书。

我想给我的客户一个已经编译的应用程序版本,这样他们需要做的就是签署它,然后将它上传到 TestFlight 和 App Store。

以前我给我的客户整个.xcodeproj,在这种情况下是从 Unity 游戏导出的,但是他们使用不同版本的 Xcode 和在不同机器上使用 CocoaPods 时出现问题。

看起来我可以通过将我的 iOS 应用程序导出到.xcarchive没有任何配置文件或签名证书的方式来做到这一点,然后将. xcarchive让他们签名,制作.ipa,然后上传到 App Store。我目前正在使用 fastlane 进行自动化构建,并希望继续使用这个新解决方案。

4

1 回答 1

0

您可以在 fastlane 中使用以下内容导出MyArchiveName.xcarchive

  build_app(
    configuration: "Release",
    project: "Path/To/My.xcodeproj",
    export_method: "app-store",
    export_options: {iCloudContainerEnvironment: "Production"},
    skip_codesigning: true,
    skip_package_ipa: true,
    archive_path: "MyArchiveName.xcarchive"
 )

然后你可以把MyArchiveName.xcarchive它交给你的客户,然后他们可以在 fastlane 中运行以下构建:

lane :sign_xcarchive_and_publish do
  default_platform(:ios)
  sync_code_signing(
    type: "appstore"
  )

  # You must create a fake xcodeproj to pass in.
  # This is needed to work around this issue in fastlane: https://github.com/fastlane/fastlane/issues/13528
  # See also: https://github.com/fastlane/fastlane/issues/11402 and https://github.com/fastlane/fastlane/issues/15876
  xcodeproj_path = File.expand_path("../fake.xcodeproj")
  Xcodeproj::Project.new(xcodeproj_path).save

  build_app(
    configuration: "Release",
    project: xcodeproj_path,
    output_name: "MyOutput.ipa",
    export_method: "app-store",
    export_options: { iCloudContainerEnvironment: "Production" },
    export_team_id: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), # This requires the team_id to be set in the fastlane `Appfile`
    skip_build_archive: true,
    skip_package_dependencies_resolution: true,
    archive_path: "MyArchiveName.xcarchive"
 )

  upload_to_testflight(
    skip_submission: true,
    skip_waiting_for_build_processing: true
  )
end

请注意,您需要验证插件是否已正确构建和签名。我还没有遇到问题,但更复杂的构建可能会。另请注意,这仅适用于客户端直接上传到应用商店,我没有尝试任何其他类型的签名。

于 2021-02-19T13:20:38.583 回答