xcode 代码签名错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9287401/
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-14 23:18:40  来源:igfitidea点击:

Code Signing Error

iosxcodeapp-storecertificate

提问by jbearden

The company I am working for has a base app that they reskin and sell to different businesses. I have redesigned the app and am trying to upload it to their account but am getting:

我工作的公司有一个基础应用程序,他们可以重新设计并出售给不同的企业。我重新设计了该应用程序并尝试将其上传到他们的帐户,但我得到:

[BEROR]Code Sign error: The identity 'iPhone Distribution' doesn't match any
valid certificate/private key pair in the default keychain

How do I add their developer account into my Xcode and acquire a certificate for distribution?

如何将他们的开发者帐户添加到我的 Xcode 中并获得分发证书?

Thank you

谢谢

回答by David

Basically, you need to have maximum privileges in the Provisioning Portal to do the following, so if you don't, get it, and then do this:

基本上,您需要在 Provisioning Portal 中拥有最大权限才能执行以下操作,因此如果没有,请获取它,然后执行以下操作:

  1. Login and download a developer certificate. If you need to create one, select How Tofrom the menu in the Provisioning Portal under certificates.
  2. Download a distribution certificate. Again, if you need one, select How To.
  3. Open both certificates and make sure they open in your Keychain Access
  4. Select provisioning and download both a developer and distribution .mobileprovision provisioning profile. Create one if necessary using How To
  5. Make sure you have XCode open and open both .mobileprovisioning profiles. Make sure that they open in the Organizer and show in the status that they are properly linked with a certificate that is valid in the Keychain Access. If they aren't, a flag will pop up, saying something like "There is no valid certificate associated with this profile" in bright red.
  6. Check your code signing in both the Targetand Projectareas of your build. Make absolutely sure that both are trying to sign using your distribution profile.
  7. Make sure that you are building the distribution schemeof your app (You may have to create this).
  8. Finally set the build device to iOS Device, set the scheme to Distribution, and select Archive. It is imperative that when the program asks you to allow the code signing to use your private key, that you select "Allow" and not "Always Allow," as this is very buggy and often results in code signing errors.
  1. 登录并下载开发者证书。如果您需要创建一个,请从证书下的 Provisioning Portal 菜单中选择How To
  2. 下载分发证书。同样,如果您需要,请选择How To
  3. 打开两个证书并确保它们在您的钥匙串访问中打开
  4. 选择配置并下载开发者和分发 .mobileprovision 配置文件。如有必要,请使用How To创建一个
  5. 确保您已打开 XCode 并打开两个 .mobileprovisioning 配置文件。确保它们在 Organizer 中打开并显示它们与Keychain Access 中有效的证书正确链接的状态。如果不是,则会弹出一个标志,用鲜红色显示类似“没有与此配置文件关联的有效证书”之类的内容。
  6. 检查您在构建的目标项目区域中的代码签名。绝对确保两者都尝试使用您的分发配置文件进行签名。
  7. 确保您正在构建应用程序的分发方案(您可能必须创建它)。
  8. 最后设置build device为iOS Device,scheme设置为Distribution,选择Archive。当程序要求您允许代码签名使用您的私钥时,您必须选择“允许”而不是“始终允许”,因为这是非常有问题的并且经常导致代码签名错误。

If you need any more help, comment.

如果您需要更多帮助,请发表评论。

Hope this helps!

希望这可以帮助!