如何使用fastlane将我的iOS应用程序编译成.xcarchive,然后单独签名并制作IPA?

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

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

我想为我的客户提供一个已编译的应用程序版本,以便他们所需要做的就是对其进行签名,然后将其上传到 TestFlight 和 App Store。

之前,我为客户提供了整个

.xcodeproj
,在本例中是从 Unity 游戏导出的,但是使用不同版本的 Xcode 时出现了问题,并且在不同的机器上使用 CocoaPods 时出现了问题。

看起来我可以通过将我的iOS应用程序导出到.xcarchive

而不需要任何配置文件或签名证书来做到这一点
,然后给他们.
xcarchive
并让他们签名,制作一个
.ipa
,并将其上传到App Store。我目前正在使用 fastlane 进行自动化构建,并希望继续使用这个新解决方案。

ios ipa fastlane codesign xcarchive
2个回答
5
投票

您可以在 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

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


0
投票

我也有同样的问题。这个问题解决了吗?

© www.soinside.com 2019 - 2024. All rights reserved.