问题描述
这是我发布的第一个问题.
This is the first question I've ever posted.
我试图在iPhone 6 Plus上运行Xcode 9.0.1项目,出现以下三个错误:
I am trying to run an Xcode 9.0.1 project on an iPhone 6 Plus and these three errors come up:
-
代码签名错误:您输入的用户名或密码不是正确.
Code Signing Error: The user name or passphrase you entered is notcorrect.
代码签名错误:未找到签名证书 iOS开发":没有与团队ID匹配的"iOS开发"签名证书找到带有私钥的"KP3X78QM3M".
Code Signing Error: No signing certificate "iOS Development" found:No "iOS Development" signing certificate matching team ID"KP3X78QM3M" with a private key was found.
代码签名错误:产品类型需要代码签名SDK"iOS 11.0"中的应用程序"
Code Signing Error: Code signing is required for product type'Application' in SDK 'iOS 11.0'
我怀疑这是由Xcode无法读取计算机上的开发人员证书引起的. 这是签名"下常规"标签的外观.单击重试"将生成一个新证书,但所有错误仍然存在.
I suspect this is caused by Xcode not being able to read the developer certificates on my computer. This is what the General tab looks like under Signing. Clicking "Try Again" will generate a new certificate but all of the errors still remain.
我检查了Keychain Access应用程序,并它具有iPhone开发人员证书,我不确定是否还有其他内容.
I checked the Keychain Access application and it has an iPhone developer certificate, although I'm not sure if anything else is missing.
我已经查找了类似的问题,并开始阅读Apple的Xcode故障排除指南,但我仍然感到困惑,不想意外修改任何重要内容.
I've looked up similar questions and started reading Apple's Xcode troubleshooting guide but I am still confused and don't want to accidentally modify anything important.
我非常需要解决此问题;如果有Apple支持电子邮件或我可以就此与我直接联系的人,那将是惊人的.
I desperately need to fix this issue; if there is an Apple support email or someone I can contact in person about this, that would be amazing.
提前谢谢!
推荐答案
我找到了解决方案!
即使这个问题只有少数观点,我也会分享,以防将来其他人遇到同样的问题.
Even though this question only has a few views, I'll share it in case anyone else has the same problem in the future.
长话短说,我退出Xcode时,常规"选项卡的签名"部分中仍然存在两个错误.此时,单击首选项->帐户->管理证书仍然会给出缺少私钥"错误消息像这样.
Long story short, I Quit Xcode while the two errors were still present in the Signing section of the General tab. At this point, clicking Preferences -> Accounts -> Manage Certificates still gave the "Missing Private Key" error messages like so.
退出Xcode后,我重新启动计算机并再次打开Xcode.在常规"选项卡的签名"部分下,它提示我使用我的Apple ID登录.登录后,这两个错误消失了.我在Mac上打开了钥匙串访问"应用程序,单击我的证书"选项卡,并注意到已经生成了一个新证书,带有一个包含新私钥的下拉箭头!
After quitting Xcode I restarted the computer and opened Xcode again. Under the Signing section for the General tab, it prompted me to log in with my Apple ID. After logging in, the two errors were gone. I opened the "Keychain Access" application on the mac, clicked on the "My Certificates" tab and noticed that a new certificate had been generated WITH a drop down arrow that contained a new private key!
要设置新密钥以便它起作用,请将您的设备(在我的情况下为iPhone 6 plus)连接到Mac,然后在该设备上运行Xcode项目.将会弹出一个标题为"codesign想要访问钥匙串中的访问键"的窗口.",需要您的计算机密码.
To set up the new key so it works, connect your device (in my case an iPhone 6 plus) to your mac and run your Xcode project on the device. A window titled 'codesign wants access key "access" in your keychain." should pop up, wanting the password for your computer.
非常重要:输入您的计算机登录密码(而不是Apple ID密码),然后单击允许"!我很困惑,第一次不小心打了"Deny",这就是让我首先陷入困境的原因.单击始终允许" !!!
VERY IMPORTANT: Type your computer login password (not your Apple ID password) and click ALWAYS ALLOW! I got confused and accidentally hit "Deny" the first time around which is what got me into this mess in the first place. Click "ALWAYS ALLOW"!!!
此后,Xcode应该可以在设备上运行您的应用了.
After this point, Xcode should be able to run your app on a device.
祝你好运!
这篇关于由于证书问题,无法在设备上运行Xcode项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!