在 ext 设备上构建时,Xcode 签名证书无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45803131/
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
Xcode Signing certificate is invalid when build on ext device
提问by Edo
I'm trying to solve an issue with Xcode 8.3.3 that prevents me to test my Apps on my devices.
我正在尝试解决 Xcode 8.3.3 的一个问题,该问题阻止我在我的设备上测试我的应用程序。
At the moment I'm using a free provisioning account for my tests. I've worked many months without any problem, then I've upgraded to Sierra and Xcode 8.3.3. Unfortunately I don't know exactly after what action/update the problem started, because I have not used Xcode for several months.
目前,我正在使用免费的配置帐户进行测试。我已经工作了几个月没有任何问题,然后我升级到 Sierra 和 Xcode 8.3.3。不幸的是,我不知道问题是在什么操作/更新之后开始的,因为我已经几个月没有使用 Xcode。
The issue: when I try to build my app to run on my iPhone, I get these errors in project page, under General > Signing view:
问题:当我尝试构建我的应用程序以在我的 iPhone 上运行时,我在项目页面的常规> 签名视图下收到这些错误:
Automatic signing failedXcode failed to provision this target. Please file a bug report at http://bugreport.apple.com/and include the Update Signing report from the Report navigator.
自动签名失败Xcode 无法配置此目标。请在http://bugreport.apple.com/提交错误报告,并包括来自报告导航器的更新签名报告。
Signing certificate is invalid.Signing certificate "iPhone Developer: [email protected] (xxxxxxx)", serial number "xxxxxxx", is not valid for code signing. It may have been revoked or expired.
签名证书无效。签名证书“iPhone Developer: [email protected] (xxxxxxx)”,序列号“xxxxxxx”,对代码签名无效。它可能已被撤销或过期。
The issue happens either on my main Mac account and also if I create a fresh new user account, it happens also if I use another AppleID account for code signing. but it doesn't happens if I boot the same machine into another macOS installation (using the same AppleID and same device). In this last case I'm able to build and run the app without any issue on my device.
问题发生在我的主 Mac 帐户上,如果我创建一个新的用户帐户,也会发生在我使用另一个 AppleID 帐户进行代码签名时。但是如果我将同一台机器引导到另一个 macOS 安装中(使用相同的 AppleID 和相同的设备),则不会发生这种情况。在最后一种情况下,我能够在我的设备上构建和运行应用程序而不会出现任何问题。
Because of that behaviour, I think that is something related to some software crap in the first OS installation, and not related to my user's "data" nor my AppleID account.
由于这种行为,我认为这与第一个操作系统安装中的某些软件垃圾有关,与我的用户的“数据”或我的 AppleID 帐户无关。
I've tried everything I've found on internet to clean-up the Xcode installation, including total removal/reinstall plus Keychain cleanup. But nothing solved the problem.
我已经尝试了我在互联网上找到的一切来清理 Xcode 安装,包括完全删除/重新安装以及钥匙串清理。但没有什么能解决问题。
I've found some related informations in this topic: https://forums.developer.apple.com/thread/83611? but no real solution.
我在本主题中找到了一些相关信息:https: //forums.developer.apple.com/thread/83611?但没有真正的解决方案。
Hope that someone could help me :)
希望有人可以帮助我:)
Bye, Edoardo
再见,爱德华多
回答by aleclarson
Here's what worked for me:
这是对我有用的:
Open "Keychain Access"
Find the private key called "iOS Developer"
Delete the private key
Try code signing again, it should work!
打开“钥匙串访问”
找到名为“iOS Developer”的私钥
删除私钥
再次尝试代码签名,它应该可以工作!
回答by Ian Keller
I had the same thing happen to me. I discovered my problem was that in my build settings
I had set my Code Signing Identity
我也发生了同样的事情。我发现我的问题是build settings
我已经设置了我的代码签名身份
Debugto iOS Developer
调试到iOS Developer
and my
和我的
Releaseto iOS Distribution
发布到iOS Distribution
Because they were different. One wasn't able to find a signing certificate. The signing certificate I had downloaded was and iOS Developer
certificate so when I switched my Code Signing Identity for Release back to iOS Developer
everything was fixed.
因为他们不一样。一个人无法找到签名证书。我下载的签名证书是和iOS Developer
证书,所以当我将我的代码签名身份切换回iOS Developer
所有内容时都已修复。
回答by Edo
After further investigation, I've found the problem. Looking at differences in keychain between my productive machine and the fresh OS installation, I've dicrovered that the "Apple Worldwide Developer Relations" CA was missing in my productive machine (no idea why...).
经过进一步调查,我发现了问题所在。查看我的生产机器和全新操作系统安装之间钥匙串的差异,我发现我的生产机器中缺少“Apple Worldwide Developer Relations”CA(不知道为什么......)。
I've erased all my developer certificates, downloaded new certificates from https://www.apple.com/certificateauthority/. After the code signing fix in Xcode, I was back able to build and run my app on my device. Strange that Xcode does not handle this kind of errors correctly, but report a "generic" error about code signing.
我已经删除了我所有的开发者证书,从https://www.apple.com/certificateauthority/下载了新证书。在 Xcode 中修复代码签名后,我可以重新在我的设备上构建和运行我的应用程序。奇怪的是 Xcode 并没有正确处理这种错误,而是报告了一个关于代码签名的“通用”错误。
回答by Asqan
Although I added the new, valid certificate to the keychain, it was not working. The solution for me was:
尽管我将新的有效证书添加到钥匙串中,但它不起作用。我的解决方案是:
1. Restarting Mac OS (because deleting certificate was not working)
2. Deleting all invalid certificates
1. Restarting Mac OS (because deleting certificate was not working)
2. Deleting all invalid certificates
You don't have to do something further. The valid certificate is being automatically used for your deployment(/development) provisioning profile.
您不必再做任何事情。有效证书将自动用于您的部署(/开发)配置文件。