ios Xcode 6 - 如何为 Ad-Hoc 分发选择签名证书/配置文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25056144/
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 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?
提问by Legoless
To distribute the app to our testers we use Xcode, which we do using the following process:
为了将应用程序分发给我们的测试人员,我们使用 Xcode,我们使用以下过程进行:
- Archive application
- Distribute for Ad-Hoc
- Choose provisioning profile
- Save the .ipa to a folder
- 存档申请
- 为 Ad-Hoc 分发
- 选择配置文件
- 将 .ipa 保存到文件夹
But with Xcode 6, this workflow was changed a bit. I can still select the Ad-Hoc distribution option, but I cannot select the provisioning profile I want. This gives us no control over which signing certificate is used and the provisioning profile configuration (we use push notifications).
但是在Xcode 6 中,这个工作流程发生了一些变化。我仍然可以选择 Ad-Hoc 分发选项,但我无法选择我想要的配置文件。这使我们无法控制使用哪个签名证书和配置文件配置(我们使用推送通知)。
By default iPhone distribution
signing identity is used and some kind of XC Ad Hoc
provisioning profile is generated, which can be seen on image below:If you click the arrow near provisioning profile, it opens the folder with provisioning profiles.
默认情况下使用iPhone distribution
签名标识并XC Ad Hoc
生成某种配置文件,如下图所示:如果单击配置文件附近的箭头,它会打开带有配置文件的文件夹。
So my question is:
所以我的问题是:
Is there any way in Xcode 6 to select the provisioning profile used with Ad Hoc distribution?
在 Xcode 6 中是否有任何方法可以选择与 Ad Hoc 分发一起使用的配置文件?
Thanks!
谢谢!
采纳答案by Aqib Mumtaz
I was facing same issue, resolved using command line "xcodebuild" tool script, which is preinstalled with Xcode 6 (didn't need 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/
Script in terminal:
终端中的脚本:
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile 'Provisioning Profile Name'
回答by GingerBreadMane
I had a similar issue when submitting to The App Store. I created an archive, then clicked "submit" and Xcode wanted to automatically sign with the default "XC com.*" wildcard provisioning profile instead of the explicit profile that already had.
我在提交到 App Store 时遇到了类似的问题。我创建了一个存档,然后单击“提交”,Xcode 想要使用默认的“XC com.*”通配符配置文件而不是已经拥有的显式配置文件自动签名。
To fix this, I just re-generated the profile on the Apple Developer Portal:
为了解决这个问题,我只是在 Apple Developer Portal 上重新生成了配置文件:
1) Go to developer.apple.com and find the distribution provisioning profile you want to use.
2) Select it, click "Edit", re-name the profile, and click "Generate".
3) Download the provisioning profile to the Desktop and drag it onto the Xcode 6 icon.
4) Re-start Xcode 6.
5) Open the organizer window and click "Submit" on the archive you built. Xcode will automatically pick your explicit profile instead of the generic one.
1) 转到 developer.apple.com 并找到您要使用的分发配置文件。
2) 选择它,单击“编辑”,重命名配置文件,然后单击“生成”。
3) 将配置文件下载到桌面并将其拖到 Xcode 6 图标上。
4) 重新启动 Xcode 6。
5) 打开管理器窗口并在您构建的存档上单击“提交”。Xcode 将自动选择您的显式配置文件而不是通用配置文件。
回答by MrPatol
Once you are in Organizer
进入管理器后
- Select the ad-hoc build and click "Export...."
- Select "Save for Ad Hoc Deployment" -> Next
- Instead of selecting an organisation from the drop down select "Use local signing asset" -> Choose
- Export and save .ipa as before.
- 选择临时构建并单击“导出....”
- 选择“保存用于临时部署”->下一步
- 不要从下拉列表中选择组织,而是选择“使用本地签名资产”-> 选择
- 像以前一样导出并保存 .ipa。
Of course you need to have generated, downloaded and installed the ad-hoc provisioning profile.
当然,您需要生成、下载并安装临时配置文件。
回答by Thorsten
It seems the last generated provisioning profile wins right now. So you can just re-generate the profile you want and download it and Xcode will use it.
似乎最后生成的配置文件现在获胜。因此,您只需重新生成所需的配置文件并下载它,Xcode 就会使用它。
A slightly better approach: set the desired prov profile in your target and use the command line to build your ipa, that works, too.
一个稍微好一点的方法:在目标中设置所需的 prov 配置文件,并使用命令行来构建您的 ipa,这也有效。
Here is the script, I'm using:
这是脚本,我正在使用:
#!/bin/sh
# Current as working as of 2014/09/22
# Xcode 6
OUTPUTDIR="$HOME/build"
APPNAME="your-app"
SCHEME="your-app"
APP_WORKSPACE="$HOME/Path/To/your-app.xcworkspace"
rm "$OUTPUTDIR/$APPNAME.ipa" #deletes previous ipa
xcodebuild -workspace "$APP_WORKSPACE" -scheme "$SCHEME" archive -archivePath "$OUTPUTDIR/$APPNAME.xcarchive"
xcodebuild -exportArchive -exportFormat ipa -archivePath "$OUTPUTDIR/$APPNAME.xcarchive" -exportPath "$OUTPUTDIR/$APPNAME.ipa"
and my settings:
和我的设置:
回答by Jonathan del Strother
I couldn't figure this out either - got bit by it when submitting to the AppStore, where it defaulted to a wildcard profile.
我也无法弄清楚这一点 - 在提交到 AppStore 时被它弄得一团糟,在那里它默认为通配符配置文件。
I ended up building in Xcode 6, then going back to Xcode 5's Organizer window for the submission. That way it'll prompt you to pick a profile to sign with.
我最终在 Xcode 6 中构建,然后返回到 Xcode 5 的 Organizer 窗口进行提交。这样,它会提示您选择要签名的个人资料。
回答by AlexHsieh
In Xcode 6 (at least 6.1 I am using now)when you are doing the export for ad hoc, xcode 6 will automatically scan if there is any provisioning profile contains all devices registered in the developer account and at the same time match the bundle ID. If no, it will use XC provision profile. Therefore, if you want to use your own profile, for example, for the purpose of push notification, you will need to select all devices in your profile on apple developer portal. I guess that's the reason why some people recreate profile would work and some wouldn't.
在 Xcode 6(我现在使用的至少是 6.1)中,当您进行临时导出时,xcode 6 将自动扫描是否有任何配置文件包含在开发者帐户中注册的所有设备并同时匹配包 ID . 如果不是,它将使用 XC 配置文件。因此,如果您想使用自己的配置文件,例如,出于推送通知的目的,则需要在苹果开发者门户的配置文件中选择所有设备。我想这就是为什么有些人重新创建个人资料会起作用而有些人不会的原因。
btw,use script can export and upload to testflight, but device just can't download it. probably somewhere I got wrong. if anyone knows why it is, pls let me know. tks
顺便说一句,使用脚本可以导出并上传到 testflight,但设备无法下载它。可能是我哪里出错了。如果有人知道为什么会这样,请告诉我。tks
回答by user3382891
This worked for me:
这对我有用:
- click "View Accounts.." within the "..select a Development Team.." dialog.
- click "View Details.." and find the XC Ad Hoc provisioning profile.
- right click on that profile and chose "Show in Finder".
- delete the selected profile.
- go back to the dialog in step 1.
- click "Chose".
- click the arrow near provisioning profile to open the provisioning profiles directory.
- delete again the generic profile like in step 4.
- click "Previous" button from the "Send [application name] to Apple:" dialog.
- select again "Save for Ad Hoc Deployment"
- click again the "choose" button.
- 单击“..select a Development Team..”对话框中的“View Accounts..”。
- 单击“查看详细信息..”并找到 XC Ad Hoc 配置文件。
- 右键单击该配置文件并选择“在 Finder 中显示”。
- 删除选定的配置文件。
- 返回步骤 1 中的对话框。
- 点击“选择”。
- 单击配置文件附近的箭头以打开配置文件目录。
- 再次删除通用配置文件,如步骤 4 中所述。
- 单击“将 [应用程序名称] 发送到 Apple:”对话框中的“上一步”按钮。
- 再次选择“Save for Ad Hoc Deployment”
- 再次单击“选择”按钮。
now you should see the right provisioning profile name.
现在您应该看到正确的配置文件名称。
回答by Adam Freeman
I have a workaround for this that works for me.
我有一个对我有用的解决方法。
I have both Xcode 6 and Xcode 5.1.1 installed, Xcode 6 is in Applications and Xcode 5.1.1 is in another directory. When I want to do a build I use Xcode 6 to create the Archive. But you can also see the created Archive in Xcode 5.1.1 so I use Xcode 5.1.1 to distribute the Ad Hoc .ipa using the provisioning profile that I want to use. So build using Xcode 6 but distribute using Xcode 5.1.1.
我安装了 Xcode 6 和 Xcode 5.1.1,Xcode 6 在 Applications 中,Xcode 5.1.1 在另一个目录中。当我想做一个构建时,我使用 Xcode 6 来创建存档。但是您也可以在 Xcode 5.1.1 中看到创建的存档,因此我使用 Xcode 5.1.1 使用我想要使用的配置文件分发 Ad Hoc .ipa。所以使用 Xcode 6 构建但使用 Xcode 5.1.1 分发。
回答by Durga Vundavalli
回答by Serge Seletskyy
The answer from @MrPatol did not work for me. My working scenario for Xcode 6.3.2
@MrPatol 的回答对我不起作用。我的 Xcode 6.3.2 工作场景
In Member Centre -> iOS Provisioning Profiles
在会员中心 -> iOS 配置文件
- Delete provisioning profile which was set by default when you were trying to build the app (e.g. "XC..."). Create an ad-hoc provisioning profile (not production) with a short name.
- 删除在您尝试构建应用程序时默认设置的配置文件(例如“XC...”)。创建一个具有短名称的临时配置文件(非生产)。
In iPhone Configuration Utility -> Provisioning Profiles
在 iPhone 配置实用程序 -> 配置文件中
- Delete the same provisioning profile (e.g. "XC...")
- 删除相同的配置文件(例如“XC...”)
In Xcode -> Organizer
在 Xcode -> 管理器中
- Select the ad-hoc build and click "Export...." Select "Save for Ad Hoc Deployment" -> Next
- Select an organisation from the drop down
- Check that your new ad-hoc provisioning profile is selected automatically
- Export and save .ipa as before.
- 选择临时构建并单击“导出....”选择“保存用于临时部署”->下一步
- 从下拉列表中选择一个组织
- 检查是否自动选择了新的临时配置文件
- 像以前一样导出并保存 .ipa。