如何安全地完全清理/重置 Xcode 中的 iOS 配置文件和证书?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20979619/
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
How to completely clean / reset iOS provisioning profiles and certificates in Xcode safely?
提问by Ken M. Haggerty
I'm having a lot of trouble trying to get my provisioning profile to work. I think there may be some UI changes between Xcode 4 and Xcode 5 that are confusing me. Nevertheless, I'd like to clean out my provisioning profiles and certificates as much as possible from Xcode and Keychain Access so that I can start fresh, so hopefully then I will be less confused about which thing does what.
我在尝试让我的配置文件正常工作时遇到了很多麻烦。我认为 Xcode 4 和 Xcode 5 之间可能存在一些让我感到困惑的 UI 更改。尽管如此,我还是想尽可能多地从 Xcode 和 Keychain Access 中清除我的配置文件和证书,以便我可以重新开始,所以希望我不会对哪些东西做什么感到困惑。
QUESTION: Any recommendations for good, exhaustive code signing tutorials for Xcode? Hopefully with visuals and/or updated for Xcode 5?
问题:对于 Xcode 的优秀、详尽的代码签名教程有什么建议吗?希望为 Xcode 5 提供视觉效果和/或更新?
Since that is a vague question, here are some possibly better questions:
由于这是一个模糊的问题,这里有一些可能更好的问题:
- Are there any Xcode-related keys or certificates in Keychain Access that are *not*safe to delete? I.s., keys / certificates that are a pain to restore (rather than just re-downloading them from the Apple Developer site)?
- Should I delete certificates whose status is "This root certificate is not trusted"? It has the red X next to it.
- Keychain Access 中是否有任何与 Xcode 相关的密钥或证书*不*可安全删除?密钥/证书是否很难恢复(而不仅仅是从 Apple Developer 站点重新下载它们)?
- 我应该删除状态为“此根证书不受信任”的证书吗?它旁边有一个红色的 X。
I'm actually trying to get push notifications working via Parse, but in the process of setting that up I think I broke everything: https://parse.com/tutorials/ios-push-notifications
我实际上是在尝试通过 Parse 来获取推送通知,但是在设置它的过程中,我认为我破坏了一切:https: //parse.com/tutorials/ios-push-notifications
I wish I knew what question to ask but I'm kindof just gaping at my computer screen like a moron... http://youtu.be/nRKHkLuZ0ZU
我希望我知道要问什么问题,但我有点像个白痴一样盯着我的电脑屏幕... http://youtu.be/nRKHkLuZ0ZU
回答by Ken M. Haggerty
Hello: I managed to get my own setup working again without fully answering my own question above :-/ so here are some insights / current ideas / remaining questions:
你好:我设法让我自己的设置再次工作,而没有完全回答我上面的问题:-/所以这里有一些见解/当前的想法/剩余的问题:
DON'T DELETE PRIVATE KEYS: Although I understand howprivate keys are generated (i.e., mathematically from the public key), I'm still not exactly sure wherethe private keys are generated. Right now it seemslike they are included when you download certificates from the Apple Developer Center website ("Certificates, Identifiers & Profiles"). The key here is that, in my quest to "delete" old certificates from Keychain Access, I was unwittingly also deleting the associated private key. I haven't been able to find a way to delete old and duplicate certificates without deleting the associated private key. My current solution, then, is don't delete old certificates, even if they are cluttering.
Another thing is that in Xcode 5 it seems like you have to select explicitly which provisioning profile you want to use. This field ("Provisioning Profile") is still under "Code Signing" under your project's "Build Settings." My memory tells me that this used to just be part of the drop-down when you selected your desired "Code Signing Identity"...but I have a bad memory. However, the screenshot in the following Stack Overflow answer suggests my memory might not be off: CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 6.0'
BACKUP YOUR (working) DEVELOPER PROFILE VIA XCODE. Here are instructions. I was lucky that I have another machine with working credentials so I could just export my developer profile from that machine and into my non-working machine: https://developer.apple.com/library/ios/recipes/xcode_help-accounts_preferences/articles/export_signing_assets.html#//apple_ref/doc/uid/TP40013306-CH8-SW1
不要删除私钥:虽然我了解私钥是如何生成的(即从公钥数学上讲),但我仍然不确定私钥是在哪里生成的。现在,当您从 Apple 开发人员中心网站(“证书、标识符和配置文件”)下载证书时,它们似乎已包含在内。这里的关键是,在我寻求从 Keychain Access 中“删除”旧证书的过程中,我无意中也删除了相关的私钥。我一直无法找到一种方法来删除旧证书和重复证书而不删除关联的私钥。那么,我目前的解决方案是不要删除旧证书,即使它们很混乱。
另一件事是,在 Xcode 5 中,您似乎必须明确选择要使用的配置文件。此字段(“供应配置文件”)仍位于项目“构建设置”下的“代码签名”下。我的记忆告诉我,当您选择所需的“代码签名身份”时,这曾经只是下拉列表的一部分……但我记性不好。但是,以下 Stack Overflow 答案中的屏幕截图表明我的记忆可能没有关闭:CodeSign 错误:SDK 'iOS 6.0' 中的产品类型 'Application' 需要代码签名
通过 XCODE 备份您的(工作)开发者资料。这是说明。我很幸运我有另一台具有工作凭证的机器,所以我可以从那台机器导出我的开发人员配置文件并导入我的非工作机器:https: //developer.apple.com/library/ios/recipes/xcode_help-accounts_preferences/文章/export_signing_assets.html#//apple_ref/doc/uid/TP40013306-CH8-SW1
Please leave comments letting me know what other information I can provide in order to make this a real answer...and maybe then I can create a good visual tutorial for others to use :-)
请留下评论,让我知道我可以提供哪些其他信息,以便使这成为一个真正的答案……也许我可以创建一个很好的视觉教程供其他人使用:-)