[英]Xcode ios app development code signing
When I run my app into my iphone I have this Warning:当我在我的 iphone 中运行我的应用程序时,我有这个警告:
unable to build chain to self-signed root for signer "".
My application Installed in iphone but it closed suddenly.我的应用程序安装在 iphone 中,但它突然关闭。
In my case,就我而言,
1- Open Keychain Access 1- 打开钥匙串访问
2- Select login, and click Certificates 2- 选择登录,然后单击证书
3- Double click Apple Worldwide Developer Relations Certificate Authority 3- 双击 Apple Worldwide Developer Relations 证书颁发机构
4- Open trust section, and set to "Use System Defaults" from "Always Trust" 4-打开信任部分,并从“始终信任”设置为“使用系统默认值”
5- Clean build folder and run 5-清理构建文件夹并运行
I too had the same error unable to build chain to self-signed root for signer...
我也遇到了同样的错误, unable to build chain to self-signed root for signer...
My mistake was that I had changed the trust setting of my distribution / developer cert to always trust
.我的错误是我将发行版/开发者证书的信任设置更改为always trust
。 When I changed it back to Use system Default
it all worked.当我将其改回Use system Default
,一切正常。
I had the same problem and basically did like posted in the comment:我遇到了同样的问题,基本上就像在评论中发布的一样:
The issue could be having your certificate set to always trust, that's the issue I had.问题可能是将您的证书设置为始终信任,这就是我遇到的问题。 If you're getting this warning that stops you from running apps on your device, this should fix everything.如果您收到此警告,阻止您在设备上运行应用程序,这应该可以解决所有问题。
I saw other answers and attempted to delete my intermediate keychains and root certificate.我看到了其他答案并试图删除我的中间钥匙串和根证书。 But Apple doesn't allow to remove Root certs unless you're in recovery mode and I didn't want to try that.但是 Apple 不允许删除 Root 证书,除非您处于恢复模式并且我不想尝试这样做。 Likely you don't have to delete anything either as this solution works without it.可能您也不必删除任何内容,因为此解决方案没有它就可以工作。
I just thought I'd add an image to clarify things.我只是想我会添加一个图像来澄清事情。 I ran into this issue when I was poking around in my Keychain and accidentally changed the default settings.当我在钥匙串中闲逛时不小心更改了默认设置时遇到了这个问题。
在此处下载更新的证书: https : //developer.apple.com/support/expiration/
After days of trying to find a consistent way, here is the solution:经过几天的努力寻找一致的方式,这里是解决方案:
It seems like a hack but it works!这似乎是一个黑客,但它的工作原理!
Go to Xcode Preferences menu ( command + , ) and then Accounts tab转到 Xcode Preferences菜单( command + , ),然后是Accounts选项卡
click on the gear icon on the bottom left and Export Apple ID and Code Signing Assets...单击左下角的齿轮图标并导出 Apple ID 和代码签名资产...
Set a password for the export设置导出密码
⚠️ You are going to delete all passwords and profiles! ⚠️您将删除所有密码和个人资料! Don't forget your password!不要忘记您的密码! Writing down your password is highly recommended.强烈建议写下您的密码。
⛔️ This file will contain all your accounts and profiles. ⛔️ 此文件将包含您的所有帐户和个人资料。 Make sure to keep it very secure.确保保持它非常安全。
Delete all accounts.删除所有帐户。
Build and face the new error.构建并面对新的错误。
Import them back using your password.使用您的密码将它们导入回来。
🎉 It's working again. 🎉它又开始工作了。
如果您能够在调试模式下安装应用程序,则您正在使用分发证书而不是开发证书,但安装完成后它会自动关闭。
One of the way to resolve IOS Codesigning issue is follow following Document.解决 IOS 编码问题的方法之一是遵循以下文档。
iOS Code Signing Troubleshooting iOS 代码签名疑难解答
And Run the following command to know the excact issue并运行以下命令以了解确切问题
spctl -a -t exec -vv <app-path>
One More Tip再一贴
After changing anything in system always clean & build your project to know if solution got applied successfully or not.更改系统中的任何内容后,请始终清理并构建您的项目,以了解解决方案是否成功应用。
It is also important to note that the physical device you are trying to deploy to must be listed in the allowed devices list for that provisioning profile -> you can see this here in the tooltip that pops up from your cert information -> you want to make sure that your device is listed in the "Devices" section.同样重要的是要注意,您尝试部署到的物理设备必须列在该配置文件的允许设备列表中 -> 您可以在从您的证书信息弹出的工具提示中看到这一点 -> 您想要确保您的设备列在“设备”部分。
You can add / remove devices when you create the provisioning profile on the apple developer portal website.您可以在 Apple 开发者门户网站上创建配置文件时添加/删除设备。
xcode -> preferences -> accounts -> select the account -> manage certificate -> click on the + icon on the bottom left of the popup window -> ios development xcode->首选项->账户->选择账户->管理证书->点击弹窗左下角的+图标->ios开发
THen you will see a new certificate created.然后您将看到创建了一个新证书。 Now you can run your app.现在您可以运行您的应用程序。
After struggling one day with many answer on forum.经过一天在论坛上的许多答案中挣扎。 I came up with solution works for me.我想出了适合我的解决方案。 below are steps for fix:以下是修复步骤:
Root Certificate Apple Inc. Root Apple Root CA - G3 Root
Intermediate Certificate Worldwide Developer Relations - G1 (Expiring 02/07/2023 21:48:47 UTC) Worldwide Developer Relations - G3 (Expiring 02/20/2030 00:00:00 UTC)
- Relaunch Keychain and go to login section of Certificate tab重新启动钥匙串并转到证书选项卡的登录部分
- Drag drop root certificates to keychain (root certificate will be trusted automatically do not make it manually )将根证书拖放到钥匙串中(根证书将被自动信任,不要手动创建)
- Drag drop intermediate certificates to keychain将中间证书拖放到钥匙串
- Drag drop app specific certificate (.p12) to keychain将应用程序特定证书 (.p12) 拖放到钥匙串
This issue happens due to apple has introduced new root certificate and intermediate certificate.出现此问题是由于苹果引入了新的根证书和中间证书。 Read more detail from https://developer.apple.com/support/wwdr-intermediate-certificate/从https://developer.apple.com/support/wwdr-intermediate-certificate/阅读更多详细信息
对我来说,只需在 Xcode 中执行Product > Clean Build Folder
就足以解决这个问题。
I'm adding the solution that fixed it for me, and is already on that thread我正在添加为我修复它的解决方案,并且已经在那个线程上
The key issue here is the root certificate这里的关键问题是根证书
Export and delete from login/certificate the certifictes named " Apple Worldwide Developer Relations Certification Authority " in your Keychain.导出并从登录/证书中删除钥匙串中名为“ Apple Worldwide Developer Relations Certification Authority ”的证书。
Do the same from system/certificate .从system/certificate执行相同的操作。
Import in system/certificate only ONE "Apple Worldwide Developer Relations Certification Authority".仅在系统/证书中导入一个“Apple Worldwide Developer Relations Certification Authority”。 I imported the one that has the expiration date set to 2030 (not 2023).我导入了过期日期设置为 2030 年(不是 2023 年)的那个。
You can also download the latest from: https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer您还可以从以下位置下载最新版本: https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
That's all.就这样。 But again, make sure it is in your Keychain's SYSTEM and you ONLY have ONE root certificate in your Keychain's SYSTEM area, AND NONE in LOGIN area.但同样,请确保它在您的钥匙串的 SYSTEM 中,并且您的钥匙串的 SYSTEM 区域中只有一个根证书,而在 LOGIN 区域中没有。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.