由于证书问题,无法在设备上运行 Xcode 项目

Can#39;t run Xcode project on device due to certificate issues(由于证书问题,无法在设备上运行 Xcode 项目)
本文介绍了由于证书问题,无法在设备上运行 Xcode 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我发布的第一个问题.

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 not correct.

代码签名错误:找不到签名证书​​iOS 开发":没有iOS 开发"签名证书匹配团队 ID找到带有私钥的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.

代码签名错误:产品类型需要代码签名SDKiOS 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.此时,点击 Preferences -> Accounts -> Manage Certificates 仍然给出Missing Private Key"错误消息 像这样.

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.在 General 选项卡的 Signing 部分下,它提示我使用我的 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 项目.应该会弹出一个标题为codedesign 想要在您的钥匙串中访问"访问密钥."的窗口,需要您计算机的密码.

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 密码),然后单击始终允许!我很困惑,第一次不小心点击了拒绝",这就是让我首先陷入困境的原因.点击始终允许"!!!

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 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)