如何熟悉代码签名问题? [英] How to become familiar with code signing issues?

查看:112
本文介绍了如何熟悉代码签名问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我处理代码签名和配置配置文件时,都会发生奇怪的事情。大多数情况下,我收到错误找不到代码签名身份,如果没有,则会出现找不到匹配的配置文件和没有有效签名身份的配置文件。

Every time when i deal with code signing and provisioning profiles strange things happens. Most times i get the error "no code signing identity found" and if not then something like "no matching provisioning profiles found" and "no provisioning profiles with a valid signing identity".

虽然我对理论以及代码签名和配置背后的事情很熟悉,但我仍然遇到很多陷阱,我不知道如何处理。有时它在设置新应用时失败,有时不会。

Although i am quiet familiar with the theory and the things behind code signing and provisioning, there are still lots of pitfalls I everytime ran into and i don't know how to deal with. Sometimes it fails when setting up a new App, sometimes not.

有5 * 2种不同的方式来选择代码签名身份。它们之间有什么区别?如果我选择一个用于调试,一个用于发布,那么任何iOS SDK的原因是什么?

There are 5*2 different ways to select code signing identity. What is the difference between them? And if i select one for debug and one for release, what is the reason for the "Any iOS SDK"?

此外,还有两个地方给出了这个对话框:项目设置 - > Buildsettings是第一个地方,也是Build Settings下的Target。两者都不同步,所以如果我在第一个位置更改代码签名,我必须在第二个位置更改它两次。有没有办法让它们保持同步?

Also, there are two places giving this dialog: Project-Settings -> Buildsettings is the first place, and also for the Target under Build Settings. Both are not in sync, so if i change the code signing at the first place, i have to change it twice in the second place. Is there a way to keep them in sync?

哪种代码签名标识最适合各种行(调试,调试 - >任何ios sdk,发布,发布 - >任何ios sdk),因为我可以在开发者身份和分发身份之间做出选择(我可以想象,分发版本用于发布,开发人员用于调试,但由于一切都失败了,我不知道。

Which code signing identity would fit best into the various lines (debug, debug -> any ios sdk, release, release -> any ios sdk), since i can choose between developer identities and distribution identities (i could imagine, that the distribution one is for release and the developer one is for debug, but because of everything fails, i don't know.

我做了什么:

我们团队的每个开发人员都在会员中心存有有效证书,团队的临时分发。
我们还创建了AppID,它反映了项目设置中完全相同的设置。在我们之间我们避免使用变量并在项目设置中使用完全appid以减少此方面的风险简化操作。

There a valid certificates in the Member Center deposited for each developer of our team and one for ad hoc distribution for the Team. We also created AppIDs which reflects exactly the same setting in the Project Settings. In between we avoid using Variables and use the exactly appid also in project-settings to reduce risks on this side and to simplify things.

将配置文件从自动切换到此应用程序的特定配置文件时,代码签名标识将更改为不同的值,即al所以在项目设置和目标构建设置之间不同步:

When switching the provisioning profile from "Automatic" to a specific Profile for this App, the code signing identities change to different values, which are also not in sync between the project settings and target build settings:

在目标 - >构建设置上,我们得到以下结果:

On the Target->Build Settings we get this result:

在项目 - >构建设置上,我们得到了不同的结果结果:

On the Project -> Build Settings we get a different result:

哪一个会更准确?
在产品 - >存档 - >验证后,我们收到以下错误:

Which one would be more accurate? After "Product" -> "Archive" -> "Validate" we get the following error:

如果我们选择不同的代码签名身份,这并不重要。实际上,只是为了播放追踪错误,我们尝试了几乎所有代码签名身份的组合来了解XCode会做什么。

It doesnt matter here if we select different Code signing identities or not. Actually, just for playing 'trail-and-error', we tried out nearly every multiple combinations of code signing identities to learn what XCode would do then.

此错误后来自存档的消息 - >验证先前选定的配置文件被替换为由随机生成的字符串命名的另一个:

After this error message from Archive->Validate the previous selected provisioning profile is replaced with another one named by a randomly generated string:


谁能告诉我这里发生了什么以及如何解决这些问题?

Who can tell me what happens here and how to solve these issues?

我已经阅读了很多关于这个主题的文件。但是,由于XCode 4和XCode 6之间发生了一些变化,因此围绕此主题的大多数教程已经过时了。即使是苹果文档也提供了基于过时的XCode版本和成员开发人员中心的过时版本的截图。

I've read a lot of documents regarding this topic. But most tutorials around this topic are outdated since several changes happened between XCode 4 and XCode 6. Even the apple documents offer mostly screenshots based on outdated XCode versions and also outdated versions of Member Developer Center.

正如Ian McDonald正确指出的那样,最后一个问题(由最后2个截图覆盖)得到了解答。重新创建供应配置文件后,它不会被随机生成的字符串替换,但IPA创建仍然无法使用未找到代码签名标识。

As Ian McDonald pointed out correctly, the last question (covered by the last 2 screenshots) is answered. After recreating the Provisioning Profile it won't be replaced by randomly generated strings, but the IPA-creation is still not working with "no code signing identities found".

什么它看起来像现在:

What it looks like now:

推荐答案

从我正在阅读的内容中,您已将目标中的配置文件从xxx.xxx更改为xxx.xxxTests,这实际上是一个不同的包标识符制作错误有效。你真的有两个行动方案:

From what I'm reading you have changed your provisioning profile in your target from "xxx.xxx" to "xxx.xxxTests" which is in fact a different bundle identifier making the error valid. You really have two courses of action:


  1. 将你的包标识符改回xxx.xxx。这是阻力最小的合适路径。

  1. Change your bundle identifier back to just "xxx.xxx". This is the appropriate path of least resistance.

在门户中创建一个新的捆绑标识符xxx.xxxTests以及新的配置文件 xxx.xxxTests绑定到相同的证书。关闭XCode后,将新的配置文件拖到您的XCode应用程序图标上,然后打开您的项目。

Create a new bundle identifier in the portal as "xxx.xxxTests" as well as a new provisioning profile for "xxx.xxxTests" tied to the same certificate. With XCode closed drag the new provisioning profile onto your XCode app icon then open your project.

你不应该有更改您的包标识符以进行测试。当您去部署时,您只需要更改目标正在编译的配置文件(开发与分发)。

You shouldn't have to change your bundle identifier to conduct testing. When you go to deploy you will only have to change which provisioning profile your target is compiling with (development vs distribution).

编辑:
我还有更多有关配置文件的提示:如何熟悉代码签署问题?

配置的快速和肮脏方面如下:

The quick and dirty side of provisioning works like this:


  • 当您添加到Apple Provisioning Portal时,证书是城堡的关键。您编译的任何代码都必须与您的证书相关联,否则您将无法正确编译/导出您的代码。

  • 您的捆绑包标识符基本上是iOS标识您的应用程序。从概念上讲,如果您想在同一设备上多次安装您的应用,请创建多个捆绑包标识符。

  • 您的配置文件将所有部分绑定在一起。 prov个人资料告诉XCode您计划使用证书来编译由捆绑包标识符标识的应用。如果它是一个开发版本,那么只有专门分配给门户网站中的prov配置文件的设备才能安装你的应用程序。

  • When you are added to the Apple Provisioning Portal your cert is the keys to the castle. Any code you compile has to be associated with your cert or you won't be able to properly compile/export your code.
  • Your bundle identifier is essentially the way iOS identifies your application. Conceptually speaking if you want to install your app multiple times on the same device create multiple bundle identifiers.
  • Your provisioning profile ties all of the pieces together. The prov profile tells XCode that you plan on using your cert to compile your app identified by your bundle identifier. If it's a development build it will only the devices specifically assigned to the prov profile in the portal will be able to install your app.

在XCode中,您需要确保目标捆绑包标识符与配置文件中的捆绑包标识符相匹配。同样,请确保您的代码签名标识与您在门户网站中设置的证书相匹配,并与配置文件相关联。最后,从代码签名标识下方的下拉列表中选择适当的配置文件。

Within XCode you need to make sure your target bundle identifier matches what bundle identifier is in the provisioning profile. Likewise make sure your code signing identity matches the cert you setup in the portal and tied to the provisioning profile. Lastly select the appropriate provisioning profile from the drop down list below the code signing identity.

这篇关于如何熟悉代码签名问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆