简体   繁体   English

Xcode 6 - 如何为Ad-Hoc分发选择签名证书/配置文件?

[英]Xcode 6 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?

To distribute the app to our testers we use Xcode, which we do using the following process: 要将应用程序分发给我们的测试人员,我们使用Xcode,我们使用以下过程:

  • Archive application 存档申请
  • Distribute for Ad-Hoc 分发Ad-Hoc
  • Choose provisioning profile 选择配置文件
  • Save the .ipa to a folder 将.ipa保存到文件夹

But with Xcode 6 , this workflow was changed a bit. 但是使用Xcode 6 ,这个工作流程发生了一些变化。 I can still select the Ad-Hoc distribution option, but I cannot select the provisioning profile I want. 我仍然可以选择Ad-Hoc分发选项,但我无法选择我想要的配置文件。 This gives us no control over which signing certificate is used and the provisioning profile configuration (we use push notifications). 这使我们无法控制使用哪个签名证书和配置文件配置(我们使用推送通知)。

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: 默认情况下,使用iPhone distribution签名身份并生成某种XC Ad Hoc配置文件,如下图所示: 出口IPA If you click the arrow near provisioning profile, it opens the folder with provisioning profiles. 如果单击配置配置文件附近的箭头,则会打开包含配置配置文件的文件夹。

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! 谢谢!

I was facing same issue, resolved using command line "xcodebuild" tool script, which is preinstalled with XCode6 (didn't need to re-install XCode5). 我遇到了同样的问题,使用命令行“xcodebuild”工具脚本解决,该脚本预装了XCode6(不需要重新安装XCode5)。

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'

I had a similar issue when submitting to The App Store. 提交到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. 我创建了一个存档,然后单击“提交”,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. 1)转到developer.apple.com并找到要使用的分发配置文件。
2) Select it, click "Edit", re-name the profile, and click "Generate". 2)选择它,单击“编辑”,重命名配置文件,然后单击“生成”。
3) Download the provisioning profile to the Desktop and drag it onto the Xcode 6 icon. 3)将配置文件下载到桌面并将其拖到Xcode 6图标上。
4) Re-start Xcode 6. 4)重新启动Xcode 6。
5) Open the organizer window and click "Submit" on the archive you built. 5)打开管理器窗口,然后在您构建的存档上单击“提交”。 Xcode will automatically pick your explicit profile instead of the generic one. Xcode会自动选择您的显式配置文件而不是通用配置文件。

Once you are in Organizer 进入组织者后

  • Select the ad-hoc build and click "Export...." 选择ad-hoc构建,然后单击“导出....”
  • Select "Save for Ad Hoc Deployment" -> Next 选择“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. 当然,您需要生成,下载和安装ad-hoc配置文件。

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: 和我的设置:

Xcode设置

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. 我最终在Xcode 6中构建,然后回到Xcode 5的Organizer窗口进行提交。 That way it'll prompt you to pick a profile to sign with. 这样它会提示你选择一个配置文件来签名。

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. 在Xcode 6中(我现在正在使用至少6.1)当您进行ad hoc导出时,xcode 6将自动扫描是否有任何配置文件包含在开发者帐户中注册的所有设备,同时与软件包ID匹配。 If no, it will use XC provision profile. 如果不是,它将使用XC提供配置文件。 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. 因此,如果您想使用自己的配置文件,例如,为了推送通知,您需要在Apple开发人员门户网站上选择配置文件中的所有设备。 I guess that's the reason why some people recreate profile would work and some wouldn't. 我猜这就是为什么有些人重新创建配置文件会起作用而有些人不会。

btw,use script can export and upload to testflight, but device just can't download it. 顺便说一句,使用脚本可以导出并上传到testflight,但设备无法下载。 probably somewhere I got wrong. 可能在某个地方我错了。 if anyone knows why it is, pls let me know. 如果有人知道它为什么,请告诉我。 tks TKS

This worked for me: 这对我有用:

  1. click "View Accounts.." within the "..select a Development Team.." dialog. 单击“..select a Development Team ..”对话框中的“查看帐户..”。
  2. click "View Details.." and find the XC Ad Hoc provisioning profile. 单击“查看详细信息...”并找到XC Ad Hoc配置文件。
  3. right click on that profile and chose "Show in Finder". 右键单击该配置文件,然后选择“在Finder中显示”。
  4. delete the selected profile. 删除所选的个人资料。
  5. go back to the dialog in step 1. 返回步骤1中的对话框。
  6. click "Chose". 点击“选择”。
  7. click the arrow near provisioning profile to open the provisioning profiles directory. 单击配置配置文件附近的箭头以打开配置配置文件目录。
  8. delete again the generic profile like in step 4. 再次删除通用配置文件,如步骤4中所示。
  9. click "Previous" button from the "Send [application name] to Apple:" dialog. 单击“发送[应用程序名称]到Apple:”对话框中的“上一步”按钮。
  10. select again "Save for Ad Hoc Deployment" 再次选择“保存以进行特别部署”
  11. click again the "choose" button. 再次单击“选择”按钮。

now you should see the right provisioning profile name. 现在您应该看到正确的配置文件名称。

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. 我安装了Xcode 6和Xcode 5.1.1,Xcode 6在Applications中,Xcode 5.1.1在另一个目录中。 When I want to do a build I use Xcode 6 to create the Archive. 当我想进行构建时,我使用Xcode 6来创建存档。 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. 但您也可以在Xcode 5.1.1中看到创建的存档,因此我使用Xcode 5.1.1使用我想要使用的配置文件分发Ad Hoc .ipa。 So build using Xcode 6 but distribute using Xcode 5.1.1. 所以使用Xcode 6构建,但使用Xcode 5.1.1进行分发。

Using local signing assets while exporting solved the issue for me: 导出时使用本地签名资产解决了我的问题: 在此输入图像描述

The answer from @MrPatol did not work for me. @MrPatol的答案对我不起作用。 My working scenario for Xcode 6.3.2 我的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 (eg "XC..."). 删除在您尝试构建应用程序时默认设置的配置文件(例如“XC ...”)。 Create an ad-hoc provisioning profile (not production) with a short name. 使用短名称创建临时供应配置文件(而非生产)。

In iPhone Configuration Utility -> Provisioning Profiles 在iPhone配置实用程序 - >供应配置文件中

  • Delete the same provisioning profile (eg "XC...") 删除相同的配置文件(例如“XC ...”)

In Xcode -> Organizer 在Xcode - > Organizer中

  • Select the ad-hoc build and click "Export...." Select "Save for Ad Hoc Deployment" -> Next 选择ad-hoc构建,然后单击“导出....”选择“保存以进行特别部署” - >“下一步”
  • Select an organisation from the drop down 从下拉列表中选择一个组织
  • Check that your new ad-hoc provisioning profile is selected automatically 检查是否自动选择了新的ad-hoc配置文件
  • Export and save .ipa as before. 像以前一样导出并保存.ipa。

Here are the two key points that solved the problem for me. 以下是解决这个问题的两个关键点。

  • When you generate the provisioning profile, it needs to be linked to an Explicit App ID that uses the same bundle identifier as your app. 生成配置文件时,需要将其链接到使用与应用程序相同的软件包标识符的显式应用程序ID A wildcard App ID will not work. 通配符应用程序ID不起作用。
  • When you export the app for ad-hoc deployment, select Use local signing asset in the dropdown and click Choose. 导出应用程序以进行临时部署时, 在下拉列表中选择“ 使用本地签名资产 ”,然后单击“选择”。

Xcode will then find the correct provisioning profile by matching up the App ID with the bundle identifier of the app. 然后,Xcode将通过将App ID与应用程序的包标识符进行匹配来找到正确的配置文件。

In fact, you need to create a new Distribution profile, specific for Ad Hoc Deployment. 实际上,您需要创建一个特定于Ad Hoc Deployment的新分发配置文件。 This can be found in the classic member center, but it is a new type of certificate. 这可以在经典会员中心找到,但它是一种新型证书。

You can then select which devices can be used to test the app as ou would do with a developer profile. 然后,您可以选择使用哪些设备来测试应用程序,就像使用开发人员配置文件一样。

And the newly created certificate will be available when you export your package from the Organizer the usual way. 当您从通常的方式从管理器导出包时,新创建的证书将可用。

Alternatively you can use the TestFlight solution provided by Apple with iOS 8 to enable your user to have access to prerelease. 或者,您可以使用Apple提供的iOS 8 TestFlight解决方案,使您的用户可以访问预发行版。

在此输入图像描述

I had the same problem, finally I solved it regenerating the profile that I wanted to use in Xcode 6 including all the devices that I have registered on my iOS Dev account, doing it that way, when selecting export it shows the correct profile and I can do the Ad Hoc export with Xcode 6 without using a script. 我有同样的问题,最后我解决了它重新生成我想在Xcode 6中使用的配置文件,包括我在iOS Dev帐户上注册的所有设备,这样做,选择导出时显示正确的配置文件和我可以在不使用脚本的情况下使用Xcode 6进行Ad Hoc导出。 Hope it helps. 希望能帮助到你。

I've been stuck for a while with this ,, but using Crashlytics solved it , build distributed using the selected profile in the build settings of your Xcode project . 我已经被困了一段时间了,但是使用Crashlytics解决了它,使用Xcode项目的构建设置中的选定配置文件进行分布式构建。

hope it helps somebody . 希望它能帮到某个人。

Almost the same problem. 几乎相同的问题。 After creating an archive for distribution (Product > Archive) you export the archive (click Export...) and choose "Save for Enterprise Deployment"; 创建分发存档(产品>存档)后,导出存档(单击导出...)并选择“保存以进行企业部署”; then "Next". 然后“下一步”。 You then select the "Development Team" default (eg organisation name) and click "Choose". 然后,选择“开发团队”默认值(例如组织名称),然后单击“选择”。 Finally you will be presented with a summary view that also lists the provisioning profile that Xcode automatically has found (maybe created on-the-fly) for you. 最后,您将看到一个摘要视图,其中还列出了Xcode自动为您找到(可能是即时创建)的配置文件。 This MIGHT be the wrong provisioning profile (typically a wildcard provisioning profile, like "XC: *") and MIGHT be happening because there already is a wildcard provisioning profile on the developer portal. 这可能是错误的配置文件(通常是通配符配置文件,如“XC:*”),并且可能会发生,因为开发人员门户上已经存在通配符配置文件。 The wildcard provisioning profile MIGHT be used by other older project and maybe it is not wise to just remove the wildcard provisioning profile from the developer portal. 通配符配置文件可能被其他较旧的项目使用,也许从开发人员门户中删除通配符配置文件是不明智的。

I used a support ticket for this and only got this link back https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringPushNotifications/ConfiguringPushNotifications.html#//apple_ref/doc/uid/TP40012582-CH32-SW1 . 我使用了支持票,只返回此链接https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringPushNotifications/ConfiguringPushNotifications.html#//apple_ref/doc/uid/TP40012582 -CH32-SW1 Not really a big help. 没有太大的帮助。

I have found that MrPatol 's solution also works for Enterprise Deployment as well and solves the problem for us. 我发现MrPatol的解决方案也适用于企业部署 ,并为我们解决了问题。 I first logged into the developer portal and manually create a provisioning profile that suited my app. 我首先登录开发人员门户并手动创建适合我的应用程序的配置文件。 Then downloaded and installed the new manually created provisioning profile. 然后下载并安装新手动创建的配置文件。

In xcode 7, I couldn't be able to pick adhoc provisioning via 在xcode 7中,我无法选择adhoc配置

Organizer -> Upload to App Store & Organizer -> Validate 管理器 - >上传到App Store&Organizer - >验证

But I could choose via Organizer -> Export 但我可以通过管理器选择- >导出

Edited: 编辑:

Uploading the app after exporting for adhoc to app store for testFlight caused another issue discussed here . 将adhoc导出到appFlight的应用商店后上传应用程序会导致此处讨论的另一个问题。 So, solution to both these problem is one. 因此,解决这两个问题就是一个问题。 Create AppStore provisioning to be able to pick it via organizer and utilize testFlight by uploading to appstore. 创建AppStore配置,以便能够通过组织者选择并通过上传到appstore来利用testFlight。

  1. I think it's a right way to specify a -exportOptionsPlist option after Xcode 7. It will choose the right provision files like in the GUI export no matter what you specify in project setting. 我认为这是在Xcode 7之后指定-exportOptionsPlist选项的正确方法。无论您在项目设置中指定什么,它都会选择正确的配置文件,如GUI导出。

xcodebuild -exportArchive -archivePath $Archive_Path -exportPath $LOCAL_PACKAGE_DIR -exportOptionsPlist $Export_Plist_Path xcodebuild -exportArchive -archivePath $ Archive_Path -exportPath $ LOCAL_PACKAGE_DIR -exportOptionsPlist $ Export_Plist_Path

optionPlist file is like this, optionPlist文件是这样的,

<dict>
  <key>teamID</key>
        <string>MYTEAMID123</string>
        <key> teamID </key>
        <string>app-store</string>
        <key>uploadSymbols</key>
        <true/>
</dict>


<plist>

app-store, enterprise, ad-hoc, development are alternative 应用商店,企业,ad-hoc,开发是另类

  1. But you may meet another error after above. 但是您可能会在上面遇到另一个错误。

Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." 错误域= IDEDistributionErrorDomain代码= 14“找不到适用的设备。” UserInfo={NSLocalizedDescription=No applicable devices found.} UserInfo = {NSLocalizedDescription =找不到适用的设备。}

It's a ruby problem. 这是一个红宝石问题。 Try this shell script, xcbuild-safe.sh 试试这个shell脚本, xcbuild-safe.sh

xcbuild-safe.sh xxxxNormalOptionsInXcodebuild bla...
  1. Wait for a moment, another strange error comes. 等一会儿,又出现了一个奇怪的错误。

xcbuild-safe.sh: line 62: shell_session_update: command not found xcbuild-safe.sh:第62行:shell_session_update:找不到命令

What's the hell shell_session_update ? 什么是shell_session_update Let us work around it. 让我们来解决它。 Just define a function before the real xcodebuild cmd, namely at the line 60 or 61. 只需在真正的xcodebuild cmd之前定义一个函数,即在第60或61行。

function shell_session_update() { :; }

In answer to your specific question, no there is no way to select the provisioning profile to be used. 在回答您的具体问题时,没有办法选择要使用的配置文件。 What are you attempting to do? 你想做什么? (ie what does the profile that you want to select allow that the automatically generated one doesn't?) (即您想要选择的配置文件允许自动生成的配置文件不是什么?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode 6 - 无法为Ad-Hoc分发选择签名证书/配置文件。 始终采取默认 - Xcode 6 - Can't pick signing certificate/provisioning profile for Ad-Hoc distribution. Always taken default iOS Ad-Hoc分发:无法使用Xcode中的分发证书签署置备配置文件 - iOS Ad-Hoc Distribution: Can't sign provisioning profile with distribution certificate in Xcode 在Xcode 6中为Ad Hoc Distribution选择配置文件 - Selecting a provisioning profile for Ad Hoc Distribution in Xcode 6 没有XC的XCode 6和Ad-Hoc分发:配置 - XCode 6 and Ad-Hoc distribution without XC: provisioning 在真实设备中测试临时配置文件-IOS XCode - Testing Ad-hoc Provisioning Profile in Real Device - IOS XCode 如何通过应用程序构建哪个配置文件? (显影剂/自组织/分布) - How to get by which provisioning profile was the app built? (developer/ad-hoc/distribution) XCode 4中的临时分发 - Ad-hoc distribution in XCode 4 如何将设备添加到现有的Ad-Hoc Provisioning Profile? - How to add a device to an existing Ad-Hoc Provisioning Profile? 如何在 Cordova 中进行临时构建(带有分发证书/配置文件的 iOS 平台)? - How to do an ad-hoc build (iOS platform with a distribution certificate/profile) in Cordova? 无法使用iTunes 11和iOS 7在临时分发测试设备上安装配置文件 - Unable to install provisioning profile on ad-hoc distribution test devices using iTunes 11 and iOS 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM