xcode 让 IPA 从开发到企业

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49051356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:34:29  来源:igfitidea点击:

Resign IPA from development to enterprise

xcodecode-signingipa

提问by avregi

Is it possible to resign an .ipa file signed with a development certificate to an enterprise certificate?

是否可以将使用开发证书签名的 .ipa 文件重新签名为企业证书?

Background: My client needs the .ipa file. He owns the enterprise certificates which he won't share with us. The idea is that I deliver the .ipa file with my own development certificate and deliver it to him. He resigns it using his enterprise certificate so he can deploy his app on his internal app store.

背景:我的客户需要 .ipa 文件。他拥有他不会与我们共享的企业证书。这个想法是我将带有我自己的开发证书的 .ipa 文件交付给他。他使用他的企业证书辞职,以便他可以在他的内部应用程序商店中部署他的应用程序。

Currently I have my .ipa file signed and I'm ready to submit the file, but I have to be certain it's possible.

目前我已经签署了我的 .ipa 文件,我准备提交文件,但我必须确定这是可能的。

I read thisarticle but the assumption there is that the provisioning profile is either for Adhoc, or Enterprise distribution .. which is not my case and I don't know if it matters.

我阅读了这篇文章,但假设配置文件适用于 Adhoc 或企业分发.. 这不是我的情况,我不知道它是否重要。

回答by Prav

It is possible to resign the ipa after it is built.

建成后可以退出ipa。

  1. Terminal way - You can try this. https://coderwall.com/p/cea3fw/resign-ipa-with-new-distribution-certificate

  2. Tool - https://github.com/xndrs/XReSign- A wonderful tool to resign the IPA.

  1. 终端方式 - 你可以试试这个。https://coderwall.com/p/cea3fw/resign-ipa-with-new-distribution-certificate

  2. 工具 - https://github.com/xndrs/XReSign- 退出 IPA 的绝佳工具。

回答by technerd

To resign ipa for enterprise or ad-hoc distribution you can follow below simple steps:

要为企业或临时分发退出 ipa,您可以按照以下简单步骤操作:

To resign app using terminal you can follow below steps:

要使用终端退出应用程序,您可以按照以下步骤操作:

  1. Unzip ipa

    unzip MyApp.ipa

  2. Remove existing signature

    rm -rf Payload/MyApp.app/_CodeSignature/

  3. Copy your Ad-Hocor enterpriseprovisioning profile to payload's embeddedprovisioning profile.

    cp ~/Desktop/MyAdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision

  4. Re-sign .appfile with related code signing identity for Ad-hocor Enterprisecertificate available in Keychain.

    codesign -f -s "iPhone Distribution: Code signing Certificate for Enterprise or Ad-hoc app" Payload/MyApp.app

  5. Zip payload and give name of ipayou want.

    zip -qr MyApp_Resigned.ipa Payload/

  1. 解压ipa

    unzip MyApp.ipa

  2. 删除现有签名

    rm -rf Payload/MyApp.app/_CodeSignature/

  3. 将您的Ad-Hocenterprise配置文件复制到负载的embedded配置文件。

    cp ~/Desktop/MyAdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision

  4. 使用 Keychain 中可用的.app相关代码签名标识Ad-hocEnterprise证书重新签名文件。

    codesign -f -s "iPhone Distribution: Code signing Certificate for Enterprise or Ad-hoc app" Payload/MyApp.app

  5. 压缩有效载荷并给出ipa您想要的名称。

    zip -qr MyApp_Resigned.ipa Payload/

回答by 7urkm3n

You can use fastlaneand resigncommand

您可以使用fastlaneresign命令

Installation in Doc.

安装在文档中。

usage:

用法:

1) fastlane init

1) fastlane init

2) fastlane/Fastlane(file)

2) fastlane/Fastlane(file)

default_platform(:ios)

platform :ios do
  desc "Resigning Current Provision"
  lane :resigner do
    resign(
      ipa: "location/appName.ipa",    
      signing_identity: "iPhone Distribution: Bbalbalbalbal.xxxxx",
      provisioning_profile: "location/xxxxx.mobileprovision",
    )
    # add actions here: https://docs.fastlane.tools/actions
  end
end

3) run fastlane ios resigner

3)运行 fastlane ios resigner

回答by DBD

Don't use development binaries for production.

不要将开发二进制文件用于生产。

You should not resign a development binary to enterprise/production binary. Development binaries normally contain lots of extra stuff which lets debug and run all the those tools which help us make our app better. These make the binary larger, slower, use more power and create security risks.

您不应将开发二进制文件转为企业/生产二进制文件。开发二进制文件通常包含许多额外的东西,可以让我们调试和运行所有那些帮助我们改进应用程序的工具。这些使二进制文件更大、更慢、使用更多功率并产生安全风险。

To answer the question, the simplest thing you can do it provide an unsigned app which your customer signs themselves.

要回答这个问题,您可以做的最简单的事情是提供一个未签名的应用程序,您的客户自己签名。

  1. Archive the app. In Menus do Product -> Archive
  2. Open the Organizer. Window -> Organizer
  3. Select the app, then archive you just created.
  4. Right click the archive and pick Show in Finder.
  1. 归档应用程序。在菜单中做产品 -> 存档
  2. 打开管理器。窗口 -> 管理器
  3. 选择应用程序,然后将您刚刚创建的存档。
  4. 右键单击存档并选择Show in Finder

From there you can either

从那里你可以

  • Deliver the whole .xcarchive (which is a ZIP file) if you want them to have the debugging info and bits.
  • 如果您希望他们拥有调试信息和位,请交付整个 .xcarchive(这是一个 ZIP 文件)。

or

或者

  • Go into the .xcarchive then into Products -> Applicationsand deliver them the unsigned .ipa file there.
  • 进入 .xcarchive,然后进入Products -> Applications并将未签名的 .ipa 文件传送到那里。

This is less work for you and prevents you from running into any pitfalls like accidentally sending them a binary you built for development.

这对您来说工作量较少,并且可以防止您遇到任何陷阱,例如不小心将您为开发构建的二进制文件发送给他们。