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

IosIos8Xcode6

Ios Problem Overview


To distribute the app to our testers we use Xcode, which we do using the following process:

  • Archive application
  • Distribute for Ad-Hoc
  • Choose provisioning profile
  • Save the .ipa to a folder

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).

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:Exporting 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?

Thanks!

Ios Solutions


Solution 1 - Ios

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).

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'

Solution 2 - Ios

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.

To fix this, I just re-generated the profile on the 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.

Solution 3 - Ios

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.

Of course you need to have generated, downloaded and installed the ad-hoc provisioning profile.

Solution 4 - Ios

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.

A slightly better approach: set the desired prov profile in your target and use the command line to build your ipa, that works, too.

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 settings

Solution 5 - Ios

I couldn't figure this out either - got bit by it when submitting to the AppStore, where it defaulted to a wildcard profile.

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.

Solution 6 - Ios

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.

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

Solution 7 - Ios

This worked for me:

  1. click "View Accounts.." within the "..select a Development Team.." dialog.
  2. click "View Details.." and find the XC Ad Hoc provisioning profile.
  3. right click on that profile and chose "Show in Finder".
  4. delete the selected profile.
  5. go back to the dialog in step 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.
  9. click "Previous" button from the "Send [application name] to Apple:" dialog.
  10. select again "Save for Ad Hoc Deployment"
  11. click again the "choose" button.

now you should see the right provisioning profile name.

Solution 8 - Ios

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.

Solution 9 - Ios

Using local signing assets while exporting solved the issue for me:enter image description here

Solution 10 - Ios

The answer from @MrPatol did not work for me. My working scenario for Xcode 6.3.2

In Member Centre -> iOS Provisioning Profiles

  • 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.

In iPhone Configuration Utility -> Provisioning Profiles

  • Delete the same provisioning profile (e.g. "XC...")

In Xcode -> Organizer

  • 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.

Solution 11 - Ios

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. A wildcard App ID will not work.
  • 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.

Solution 12 - Ios

In fact, you need to create a new Distribution profile, specific for 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.

enter image description here

Solution 13 - Ios

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. Hope it helps.

Solution 14 - Ios

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 .

hope it helps somebody .

Solution 15 - Ios

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 (e.g. 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. 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. 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. 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. 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.

Solution 16 - Ios

In xcode 7, I couldn't be able to pick adhoc provisioning via

Organizer -> Upload to App Store & Organizer -> Validate

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. 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.

Solution 17 - Ios

  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.

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

optionPlist file is like this,

http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<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

  1. But you may meet another error after above.

> Error Domain=IDEDistributionErrorDomain Code=14 "No applicable > devices found." UserInfo={NSLocalizedDescription=No applicable devices > found.}

It's a ruby problem. Try this shell script, xcbuild-safe.sh

xcbuild-safe.sh xxxxNormalOptionsInXcodebuild bla...

3. Wait for a moment, another strange error comes.

> xcbuild-safe.sh: line 62: shell_session_update: command not found

What's the hell shell_session_update ? Let us work around it. Just define a function before the real xcodebuild cmd, namely at the line 60 or 61.

function shell_session_update() { :; }

Solution 18 - Ios

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? (i.e. what does the profile that you want to select allow that the automatically generated one doesn't?)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLegolessView Question on Stackoverflow
Solution 1 - IosAqib MumtazView Answer on Stackoverflow
Solution 2 - IosGingerBreadManeView Answer on Stackoverflow
Solution 3 - IosMrPatolView Answer on Stackoverflow
Solution 4 - IosThorstenView Answer on Stackoverflow
Solution 5 - IosJonathan del StrotherView Answer on Stackoverflow
Solution 6 - IosAlexHsiehView Answer on Stackoverflow
Solution 7 - Iosuser3382891View Answer on Stackoverflow
Solution 8 - IosAdam FreemanView Answer on Stackoverflow
Solution 9 - IosDurga VundavalliView Answer on Stackoverflow
Solution 10 - IosSergiy SeletskyyView Answer on Stackoverflow
Solution 11 - IosSarah ElanView Answer on Stackoverflow
Solution 12 - IoscdescoursView Answer on Stackoverflow
Solution 13 - IosdiegomenView Answer on Stackoverflow
Solution 14 - IosM.OthmanView Answer on Stackoverflow
Solution 15 - IossejersbolView Answer on Stackoverflow
Solution 16 - IoszeeawanView Answer on Stackoverflow
Solution 17 - IosVictor ChoyView Answer on Stackoverflow
Solution 18 - Iosclarkcox3View Answer on Stackoverflow