Can#39;t run Xcode project on device due to certificate issues(由于证书问题,无法在设备上运行 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 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:由于证书问题,无法在设备上运行 Xcode 项目
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01