XCode 6 and Ad-Hoc distribution without XC: provisioning - ios

Yesterday I've downloaded Xcode 6 and now I have got a problem I can't solve. In my member center I've got valid certificate and ad-hoc provisioning (distribution). Till yesterday, in Xcode 5 if I wanted to add my .ipa to TestFlight I was using Archive and selecting my valid ad-hoc profile. I wasn't even logged in in my developer account in Xcode.
Now - in Xcode 6 - nothing is working at all. Ok, I've logged in preferences, Xcode downloaded all my provisionings on Mac, but whenever I choose Export it says that I don't have matching provisioning profile and it's creating new provisioning profile with XC: prefix - which I don't want to use, because it contains all devices I have in member center - even those I don't want to include in my app!
I was trying everything from this threads:
Xcode 6 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?
Xcode 6 GM creating archive
but nothing is working for me. Maybe I don't understand correctly how it works and there is a trick I have to do but I would like to use provisioning profile defined by me. I was trying to create new provisioning profile, rename the old one, remove all from Mac, drag provisioing profile from desktop to Xcode icon, select correct Provisioning Profile in Build Setting all over again but I'm stuck.
Screenshots here:
My Ad-hoc profile is distribution profile.

There is no way to get Xcode 6.x to use an ad-hoc profile that doesn't contain all of the devices on your team; this is by design.

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. It works for me.

Xcode6 will now always create a new AdHoc provisioning profile prefixed with 'XC' when you export an archive for testing (e.g. Hockey App). In order to do this you must always have the latest App Store Distribution certificate and private key in your keychain.
NOTE: You do not have to have this latest distribution certificate selected in your provisioning profile you built the archive with. Also keep in mind you do not need to have an AdHoc provisioning profile to export an AdHoc ipa.
When you export the first time you will probably receive an error saying that you do not have an AdHoc provisioning profile with the following devices/people in it. Just hit 'Try Again' and it will work.
Something else to keep in mind is that when exporting an ipa you are forced to test push notifications through their distribution/production servers as it is using the new self generated 'Distribution XC: AdHoc' provisioning profile.
If you are using Urban Airship like we are you can no longer use development keys for testing. If you look under 'Entitlements' once you get through the steps to export it will show you that 'aps-environment' is set to 'production'. If anyone finds an alternate solution for this let me know.

I was facing similar issue with my distribution license, and the problem was there was "XC" provisioning profile which had the exact same bundle id.
My solution to his was to delete this XC: provisioning profile both from Apple Developer Portal and Xcode -> Preferences -> Apple ID -> View Details -> XC: provisioning profile -> right click Go To Finder -> delete
Hope this helps,

I encountered the same issue. On one of the StackOverflow threads you linked to, a solution was recently added that worked for me.
After you have created the archive, you can export it with a specific provisioning profile from the command line:
xcodebuild -exportArchive -archivePath "~/Library/Developer/Xcode/Archives/{some-date}/{appname date, time.xcarchive" -exportPath {appname} -exportFormat ipa -exportProvisioningProfile "{provisioning profile name}"
Note that the provisioning profile name is just the name, without any path or file extension.

I ran into this today as well.
I ended up removing the XC profile from the developer portal and recreating my other ad-hoc and app store profiles and downloading them again.
After I did this, when I built and tried to submit to app store, the correct App Store profile showed up AND when I went to export for ad-hoc, the correct ad-hoc profile showed up.
Yay ;)

I hit a similar problem and discovered that even if you specify the correct profiles in Xcode the Xcode6 system wants you to have the latest (from member centre) provisioning profile (for each team your account is against). It seems to walk each one in turn before using the one you need and gets blocked if you are absent any provisioning profile for the teams you belong to.

I ran into this.
No solution here worked.
I ended up moving to a command line build using nomad cli shenzen. Its another great open source project by mattt
Now I go into a shell and just type:
ipa build
DONE
They even have options to send the ipa to whatever Ad Hoc service you want. Awesome.

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.

My way is much simpler:
I go to the developer - provisioning profiles and re-create my Ad Hoc profile by choosing 'Edit' then 'Generate', download it and install with double-click. When exporting .ipa the correct (mine) profile is chosen.
Apple only uses the last built provisioning profile, obviously.

Related

iOS how to add a provisioning profile

I am using Xcode Version 8.3.3 (8E3004b). I have an app developed that I would like to deploy to Apple's App Store.
In order to Archive and deploy, I understand I first need a provisioning profile. So, in the developer console, I set up an iOS Distribution Provisioning Profile.
I also have the following certificates:
On my MacBook, I added the following certificates to the key chain:
Then when I go to Xcode, I would expect to have a Provisioning Profile:
But as you can see, it Failed to create provisioning profile and No profiles for 'com.ionicframework.thewhozoo912107' were found.
I am obviously missing some step in order to create the Provisioning Profile in order to distribute the app to the Apple App Store.
Question
If anyone can suggest what I need to do in order to create a working provisioning profile in order to distribute the app, I would appreciate the help.
More info:
Solution:
I fixed this in Xcode by unchecking Automatically Manage Signing, and then selecting my provisioning profile.
I had that problem as well when I was developing my first app. It took a while, since I managed it. Try to plug your iOS device in your computer and then it should work.

Xcode 6 - Can't pick signing certificate/provisioning profile for Ad-Hoc distribution. Always taken default

To distribute the app we are using Xcode 6.0.1, where we encountered some issues by using the following process:
Added App-Id and distribution provision profile under developer program.
Chose provision profile under build settings and Archive application.
Chose Export option to do Ad-HocDistribute.
But with Xcode 6.0.1, this workflow was changed a bit. I couls still select the Ad-Hoc distribution option, but I cannot select the provisioning profile which I have created under developer program against my App-ID. There were no listing of provisional profile as we use to do in Xcode 5 version.
The Xcode 6.0.1 has tried to match the provisional profile from the dev-program and it returns message as no matching certificate and it automatically created identity as XC Ad Hoc * profile. Once I chose the Export option the XC Ad Hoc* profile has been created automatically under the distribution provision profile option in dev-program.
Under the provision profile all devices has been selected which I have added and listing total devices under my testflight application. Please assist me how to choose my provision profile which I have already created specifically for my application. Its really consume my whole day.
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.
In Xcode 7 try to select "Use local signing assets" when selecting team. In my case it automatically selected custom Ad-Hoc profile, instead of XC Ad-Hoc*
It's quite tricky but in your app build settings, you don't have the good provisioning and/or the good code signing identity for the archive mode (RELEASE) and maybe be the bad team too. You have to re set all this things and re archive. You know it's good when Xcode show the good certificate.
Hope you will export your application.
Organizer -> Export worked for me as Organizer -> Upload to App Store and Validate were picking Xcode generated provisioning every-time.
Similar topic discussed here.

Using xcode 6 beta 6 we are unable to Create an ipa file [duplicate]

I'm having trouble exporting an app for Ad Hoc Distribution on Xcode 6 beta 2:
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?
I've had the same issue two days ago. Turns out the problem was:
I have my own developer distribution certificate with a proper private key
I have enterprise developer distribution certificate of my client without a 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
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 enterprise distribution 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.
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.
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.
That's it!
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).
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"
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.
I get a solution without renew the certificate:
1 - Archive the target with the appropiate Code Signing Identity and Provisioning Profile
2 - Right button in the created file in Organizer --> Show in Finder
3 - Right button in the xcarchive file --> Show package content
4 - There, in Finder, go to Products/Applications/
5 - Upload the file Products/Applications/appName to iTunes
6 - When the app appear in iTunes, right click on it --> Show in Finder. This is the ipa file
7 - Send this ipa through App Loader 3.0
I dont think that it is a lasting solution but do not want to delete my certificates
FINALLY SOLVED IT!!
1) Create a NEW production certificate through developer.apple.com which requires you to use Keychain Access to create a new private key on your computer
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
3) Run your app, Archive it, then export the archive.
viola
This took me days if not weeks to figure out, I hope it helps you.
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.
I faced the same issue today with 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).
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.
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.
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.
Hope this helps someone :)
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.
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:
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”.
Now you have the .ipa file which you can send to your testers for testing.
Hope this helps.
There has been changes in way apple manages our private and public key.
The previous method to share account on two machine was
1.download provisioning
2.export/checkout certificate
install them both on the other mac
but now you dont have to do that you export your entire account.
1.XCode -> preferences -> account (select account) on bottom left there is option to export that
you will be prompted to give a password give any it will be required while importing on other system.A .developerprofile file will be downloaded on location of your choice.
2.download it on other mac and when you see the prompt your device already have valid signing identity click on import Developer Profile and import this .developerprofile file. enter password when prompted.
got help from here
I resolved it following the next steps:
1)in your apple developer account: Create a new Production Certificate Choose the App Store and Ad Hoc Option
2)in your apple developer account: Create a new provisioning profile with you current bundle id and the certificate created in the step one
3)in your xcode:
Select your target
In the tab Build Settings in the zone Code Signing
In the sub-zone Code Signing Identity - Release
Set your new distribution certificate (ad hoc)
In the Provisioning Profile - set your new provisioning profile (ad hoc)
Seems that xcode 6 now requires an ad hoc distribution certificate in order to export your IPA.
I got the same issue today, and found a good solution I think.
First of all, there're something unnormal:
the normal is:
and in the keychain:
the normal is:
then, I realize that I lack the the correct provisioning profile which contains the correct iOS Distribution certificate.
Finally, my solution is: use my CertificateSigningRequest.certSigningRequest file to generate a new iOS distribution certificate, and use the new iOS distribution certificate to generate a new provisioning profile.
Note, I don't delete the old certification and provisioning profile, because my colleague works well with them. Does this affect the apps I already published? The answer is NO. I just change the code signing certificate, and some important certificate like push notification certificate is ties with app ID:
So don't worry about that.
Hope the above is helpful.
As pointed out by a commenter this has proven to be a solution for myself and others:
I deleted and re-downloaded all my required certificates along with the keys needed to generate and i was able to get past this error
I revoke my producion certificates, and request another one, solve this problem.
Maybe you need restart your xcode.
I just encountered this after upgrading from Xcode 5 to 6.
In my case creating a new production certificate and then recreating the distribution provisioning profile for my app did the trick.
In the official latest Xcode 6.0, this will happen if you accidentally created a record in your entitlements file that has a key like this:
com.apple.security.application-groups
I am not sure if Xcode automatically created it by default. But deleting that key solved my problem. I didn't have to recreate any certificates. It was not my problem.
I solved this by simply regenerating the provisioning profile on the developer portal (in my case an App Store profile) and adding to my computer via iPhone Configuration Utility. I didn't want to mess with the certificates and successfully avoided that.
I noticed this error message logged from Xcode in my console:
None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups.
After downloading a the new provisioning profile, the missing beta-reports-active = true was present and Xcode signed the build.
My Solution was Delete the only iOS Production Certificate which I'm using and create it again. Doing this, you must create a new Provisioning profile assigning the certificate just created.
then I did the process of Archive again and works!
Additionally I found that Xcode Accounts come into play -
It turned out that I did have a valid distribution certificate on my personal account (mobilology) so I deleted that account temporarily from the Accounts section (you may wish to leave only that account that you are distributing from).
Suddenly the signing / archiving process worked!
Step1:-Login to your apple developer account
Step2:-Choose Certificates
Step3:-Delete if there are more than one distribution certificates
Step4:-Then retry archiving ( if error still exist, revoke all certificates and create new distribution certificate and edit your provision profiles.)
I think its a bug from Xcode. to make it work, i need delete the actual distribution provisional profile and i had to make a new provisional distribution profile from devcenter. This works from me
I also faced the same problem, i was using development certificate instead of Adhoc. Issue is fixed after using Adhoc certificate.
Delete you ios Distribution certificate from the apple developer site and regenrate the ios Distribution with the certSignReq file. Works for me always. Your other apps wouldnt be affected . Atleast in my case it never did.
In my case I generated a new distribution profile and added it to XCode, then tried to submit the build. Turns out, all I had to do to get rid of this message is restart XCode and attempt again to submit. Worked.
In my case, I got the error message when trying to export and AdHoc build from Organizer. I did two things, either of which may have fixed the issue:
1) Exported the existing certificate it claimed I did not have from my keychain, deleted it from keychain, re-imported.
2) Created an ad-hoc distribution certificate, refreshed XCode account to obtain the new distribution provisioning profile.
After that I was able to export the exact same archive to an AdHoc build. I really think it was only that fact I was missing an ad-hoc distribution that targeted that specifc bundleID that led to XCode being confused.
Followup: The archive I had created before did not work, I had to re-generate it. A clue this was an issue was that when selecting the archive and opting to export an Ad-Hoc build, the default account selected was the wrong account for the build (the project had no default account selected when I archived the build).
This is what worked for me (Enterprise Account)
Import the developer profile from the other machine, which loaded the certificate I needed with the secret key.
Rename the app bundle to the enterprise name (it was named under the app store name).
Change the team name in the "General" tab to my company's team - it was defaulting to my personal developer account!
With these changes, I could export an ipa as both ad-hoc and enterprise, upload it to Hockey Rink, and download it on my phone

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:
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:
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!
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'
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.
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.
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:
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.
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
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.
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. 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.
Using local signing assets while exporting solved the issue for me:
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.
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.
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.
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.
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 .
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.
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.
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,
<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
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...
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() { :; }
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?)

Test Flight Error: Invalid IPA: missing embedded provisioning profile - How do I fix this?

I'm trying to package my app up and distribute an ad hoc version via Test Flight. I've already packaged and submitted the app to the app store so I'm trying to figure out which settings I need to change to make it work for ad hoc.
When I try to upload my .ipa in Test Flight I get "Invalid IPA: missing embedded provisioning profile"
I tried following the instructions from Test Flight here: http://support.testflightapp.com/kb/tutorials/how-to-create-an-ipa-xcode-4 But there isn't even in option of "Code Signing" for me in Xcode (v4.2).
I've created an ad hoc provisioning profile and downloaded it into Xcode.
I've changed the code signing identity in build settings (for both target and project) and after archive I've attached the ad hoc provisioning profile when sharing the .ipa.
I'm still getting the error. Any thoughts on what else I might need to do?
Thanks.
The entitlements pane is now in project properties -> summary.
I would try cleaning your app, and re-archive. Make sure that Xcode recognizes your AdHoc profile. It can be quite the pain in the ass to get Xcode to pick up your profile due to conflicts in your keychain. Open Organizer, select Provisioning Profiles, and make sure your AdHoc profile doesn't have any issues. If it does, you will probably need to clear out your keychain and profiles and start nice and clean. I have a post on SO that might help you. Use Device Instead of Simulator
If you aren't having any issues with your profiles, try and just attach it after you upload your ipa file to TestFlight.
For anyone who is still experiencing this error:
I was experiencing this issue with XCODE 4.3.
1 . Make sure you have a Ad-Hoc Cert :
YouTube Tutorial
After Archiving and Selecting the Distribute via Ad-Hoc option, Make sure that you Update your list of keys. The option is at the bottom of the list. And select the Ad-Hoc cert if you just had to create one.
i.e. Product > Archive > Distribute > "Save for Enterprise or Ad-Hoc Deployment" >
Next > Code Signing Identity ** Refresh Code Signing identity **
If you are planning on distributing your application via TestFlight you will need an Ad-Hoc provisioning profile generated through your Apple Developer account.
Every application I build has at least 2, often 3, different provisioning profiles assigned to them.
Development
Ad-Hoc for outside testing
Distribution

Resources