导出 .ipa 的 Xcode 6 beta 2 问题:“您的帐户已经拥有有效的 iOS 分发证书”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24438010/
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 6 beta 2 issue exporting .ipa: "Your account already has a valid iOS distribution certificate"
提问by 3254523
I'm having trouble exporting an app for Ad Hoc Distribution on Xcode 6 beta 2:
我在 Xcode 6 beta 2 上为 Ad Hoc Distribution 导出应用程序时遇到问题:
When exporting my project for ad hoc development on Xcode 6, I receive this alert. I've tried exporting it on Xcode 5 and had no problems at all saving the .ipa. Is anyone experiencing this problem as well?
在 Xcode 6 上导出我的项目以进行临时开发时,我收到此警报。我试过在 Xcode 5 上导出它并且保存 .ipa 没有任何问题。有人也遇到这个问题吗?
采纳答案by Adnan
This is what worked for me.
这对我有用。
On my machine I kept both Xcode 5 and Xcode 6 beta.
From Xcode 6 beta, Archive the project. Close Xcode 6.
Open Xcode 5, go to Organizer and export as Ad Hoc build with proper provisioning profile.
在我的机器上,我保留了 Xcode 5 和 Xcode 6 beta。
从 Xcode 6 beta 开始,归档项目。关闭 Xcode 6。
打开 Xcode 5,转到 Organizer 并使用适当的配置文件导出为 Ad Hoc 构建。
That's it!
就是这样!
回答by Alexander Vasenin
I've had the same issue two days ago. Turns out the problem was:
两天前我遇到了同样的问题。原来问题是:
- I have my own developer distribution certificate witha proper private key
- I have enterprise developer distribution certificate of my client withouta private key
- I try to make an enterprise distribution package for my client
- Xcode throws at me vague error: Your account already has a valid iOS distribution certificate
- 我有自己的开发者分发证书和适当的私钥
- 我有没有私钥的客户的企业开发者分发证书
- 我尝试为我的客户制作一个企业分发包
- Xcode 向我抛出模糊错误:您的帐户已经拥有有效的 iOS 分发证书
The solution is: get a private key for enterprise account of my client. There are 2 possible options:
解决方案是:获取我客户的企业帐户的私钥。有两种可能的选择:
- Ask you client for credentials to access his enterprise developer account on Apple website. Revoke old certificate and recreate it. You'll create the private key in the process. BEWARE: revoking an enterprisedistribution certificate invalidates all apps that were signed and deployed with that certificate (official info).
- Ask your client to export his private key from his Keychain Access application as a *.p12 file and send it to you with a password. You can't download the existing private key from the Apple website. The only way to get it is to ask your client. I did it and it and I was able to finally make the package.
- 向您的客户索取凭据以访问其在 Apple 网站上的企业开发者帐户。撤销旧证书并重新创建它。您将在此过程中创建私钥。注意:撤销企业分发证书会使所有使用该证书签名和部署的应用程序无效(官方信息)。
- 要求您的客户从他的 Keychain Access 应用程序中将他的私钥导出为 *.p12 文件,并通过密码将其发送给您。您无法从 Apple 网站下载现有的私钥。获得它的唯一方法是询问您的客户。我做到了,而且我终于能够制作包装。
How to find out if you have a private key for a certificate: Open Keychain Access application. Choose certificates. Find your certificate. If you see small grey triangle on the left side of the certificate, open it and you see your private key. No triangle = no private key.
如何确定您是否拥有证书的私钥:打开钥匙串访问应用程序。选择证书。找到您的证书。如果您在证书左侧看到小灰色三角形,打开它,您会看到您的私钥。没有三角形 = 没有私钥。
回答by Chris Comeau
I had the same problem, I had to use the command line "xcodebuild" tool as a workaround, with only Xcode 6 installed (didn't have to re-install Xcode 5).
我遇到了同样的问题,我不得不使用命令行“xcodebuild”工具作为解决方法,只安装了 Xcode 6(不必重新安装 Xcode 5)。
http://www.thecave.com/2014/09/16/using-xcodebuild-to-export-a-ipa-from-an-archive/
http://www.thecave.com/2014/09/16/using-xcodebuild-to-export-a-ipa-from-an-archive/
Example:
例子:
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"
回答by lucaslt89
In my case, what solved the problem was deleting all Distribution Certificates from my Apple Developer Account. Then, Xcode managed to create development and distribution certificates again, and that did the trick.
就我而言,解决问题的是从我的 Apple 开发人员帐户中删除所有分发证书。然后,Xcode 设法再次创建了开发和分发证书,就成功了。
回答by Pedro Lorente
I get a solution without renew the certificate:
我在不更新证书的情况下获得了解决方案:
1 - Archive the target with the appropiate Code Signing Identityand Provisioning Profile
1 - 使用适当的代码签名身份和配置文件归档目标
2 - Right button in the created file in Organizer--> Show in Finder
2 - 在管理器中创建的文件中的右键-->在 Finder 中显示
3 - Right button in the xcarchivefile --> Show package content
3 - xcarchive文件中的右键-->显示包内容
4 - There, in Finder, go to Products/Applications/
4 - 在Finder 中,转到 Products/Applications/
5 - Upload the file Products/Applications/appName to iTunes
5 - 将文件 Products/Applications/appName 上传到 iTunes
6 - When the app appear in iTunes, right click on it --> Show in Finder. This is the ipa file
6 - 当应用程序出现在 iTunes 中时,右键单击它 -->在 Finder 中显示。这是ipa文件
7 - Send this ipa through App Loader 3.0
7 - 通过 App Loader 3.0 发送此 ipa
I dont think that it is a lasting solution but do not want to delete my certificates
我不认为这是一个持久的解决方案,但不想删除我的证书
回答by Hymansonkr
FINALLY SOLVED IT!!
终于解决了!!
1) Create a NEW production certificate through developer.apple.com which requires you to use Keychain Accessto create a new private key on your computer
1) 通过 developer.apple.com 创建一个新的生产证书,这要求您使用Keychain Access在您的计算机上创建一个新的私钥
2) In the same developer portal, open your distribution Provisioning Profile used with this app and select the new production certificate which you just created. Generate the provision then download it and run it
2) 在同一个开发人员门户中,打开与此应用程序一起使用的分发配置文件,然后选择您刚刚创建的新生产证书。生成配置然后下载并运行它
3) Run your app, Archive it, then export the archive.
3) 运行您的应用程序,将其存档,然后导出存档。
viola
中提琴
This took me days if not weeks to figure out, I hope it helps you.
这花了我几天甚至几周的时间才弄明白,我希望它可以帮助你。
回答by Yucel Bayram
Create new iOS Distributon Certificate and choose Production> App Store & AdHoc section. Also don't forget to change Target>Build Settings> Code Signing all to iOS Distribution.(but after created ipa set it back to iOS Developer) Only this solved my problem.
创建新的 iOS 分发证书并选择 Production> App Store & AdHoc 部分。也不要忘记将 Target>Build Settings> Code Signing 全部更改为 iOS Distribution。(但在创建 ipa 后将其设置回 iOS Developer)仅此解决了我的问题。
回答by Angel Naydenov
I faced the same issue today with Xcode 6.1.1
我今天在 Xcode 6.1.1 上遇到了同样的问题
When I tried to add iOS Distribution certificate via Xcode the error I got was the same. There were already several issued distribution certificates in Member Center and I did not want to invalidate them because if they are used for Ad Hoc distribution in an Enterprise environment this would also invalidate the applications that are installed on the devices (at least this is what I've read).
当我尝试通过 Xcode 添加 iOS 分发证书时,我得到的错误是一样的。Member Center 中已经有几个已颁发的分发证书,我不想使它们失效,因为如果它们用于企业环境中的 Ad Hoc 分发,这也会使设备上安装的应用程序失效(至少这是我的已读)。
What I did was:
1. Through Keychain Access generated a request for a certificate from a certification authority. And saved the request to a file;
2. Logged in to Member Center certificates area Production section and requested a new "App Store and Ad Hoc" production certificate, this requested the file from step 1;
3. Downloaded the new certificate and when imported in Keychain Access it now had a private key.
我所做的是:
1. 通过 Keychain Access 生成了来自证书颁发机构的证书请求。并将请求保存到文件中;
2. 登录会员中心证书区域制作版块,申请新的“App Store and Ad Hoc”制作证书,此为步骤1中的文件;
3. 下载了新证书,在 Keychain Access 中导入后,它现在有了一个私钥。
Afterwords I cleaned Xcode, restarted it, checked that in my account the profile is visible and built a new Archive. And now I was able to validate the archive.
之后我清理了 Xcode,重新启动它,检查我的帐户中的配置文件是否可见并构建了一个新的存档。现在我能够验证存档。
Now if I try to request a new "App Store and Ad Hoc" certificate this option is grayed out for me and I suppose this is because my account already has the certificate issued. If this is your case you will most probably need to invalidate your previous certificate before you can issue a new one. This is why Apple recommend backing up your certificate. But it is very likely that you will not need to invalidate all production certificates as I already have a number of those in the profile.
现在,如果我尝试申请一个新的“App Store 和 Ad Hoc”证书,这个选项对我来说是灰色的,我想这是因为我的帐户已经颁发了证书。如果是这种情况,您很可能需要先使之前的证书失效,然后才能颁发新证书。这就是 Apple 建议备份您的证书的原因。但是很可能您不需要使所有生产证书无效,因为我在配置文件中已经有了一些证书。
Hope this helps someone :)
希望这对某人有所帮助:)
回答by Son Nguyen
Apple has changed the way of Ad Hoc build. Now you can't make Ad Hoc distribution builds using dev cert. You should use a distribution cert with an "Ad Hoc" provisioning profile instead.
Apple 改变了 Ad Hoc 构建的方式。现在您无法使用开发证书制作 Ad Hoc 发行版。您应该使用带有“Ad Hoc”配置文件的分发证书。
回答by shah1988
I believe the actual reason you ended up in this screen is while trying to get the .ipa file to be distributed to your testers and clients. In Xcode 6, to get the .ipa file you may use the old method for iPA generation:
我相信您最终出现在此屏幕上的实际原因是试图将 .ipa 文件分发给您的测试人员和客户。在 Xcode 6 中,要获取 .ipa 文件,您可以使用旧的 iPA 生成方法:
- Select organiser in Xcode. In the Archives tab select the Archive whose iPA file you need to generate.
- Right click and select option “Show in Finder”
- You will see the .xarchive file. Right click and select “Show Package Contents”
- You will see folders: dSYMs, Info.plist and Products.
- Open Products>Applications and you will see your .app file.
- Drag and drop this .app file to iTunes in Mac.
- Your .app file will be listed under "My Apps" in iTunes.
- Right click on your application and select “Show in Finder”.
- 在 Xcode 中选择组织者。在“档案”选项卡中,选择您需要生成其 iPA 文件的档案。
- 右键单击并选择选项“在 Finder 中显示”
- 您将看到 .xarchive 文件。右键单击并选择“显示包内容”
- 您将看到文件夹:dSYMs、Info.plist 和 Products。
- 打开产品>应用程序,您将看到您的 .app 文件。
- 将此 .app 文件拖放到 Mac 中的 iTunes。
- 您的 .app 文件将列在 iTunes 中的“我的应用程序”下。
- 右键单击您的应用程序,然后选择“在 Finder 中显示”。
Now you have the .ipa file which you can send to your testers for testing. Hope this helps.
现在您拥有了 .ipa 文件,您可以将其发送给您的测试人员进行测试。希望这可以帮助。