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

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.

Related

Can't use the iOS distribution in Xcode

In my Xcode 9 project I have the Automatically manage signing checked. I want to sign the application with the iOS distribution certificate. For some reasons, when I was creating the certificate I entered the name and email of another person. In the keychain Access I can see the public and private keys with the name of that person and under the private one, the iPhone distribution certificate. The problem is that in Xcode when I select the Team, I'm only getting the iPhone developer signing certificate and not the the distribution one. But from the Build Setting I can see the iPhone distribution in the select list of the Code Signing Identity. Once I select it, Xcode detect a conflict of the provisioning profile (because I change it manually and the Automatically manage signing is checked). I tried the solution of check then uncheck it and select the team but the problem is still here.
Make sure your Scheme under the Left top corner of App name Dropdown-->Edit Scheme is enabled to Release and not Debug for Archive and Testing also so automatically your Distribution is selected.
When you use the Automatic provisioning by default you are getting two profiles generated in Xocde One when you connect the device it used Dev Profile for debugging, but when you archive the build it autogenerates Distribution profile. If you have enterprise account, I would recommend having a universal distribution profile created and not Adhoc as it will always have to be updated with new Device ID added to be regenerated and recompiled the old app.
you just uncheck "Automatically signing" option. Once you uncheck only profile selection option will be enabled. Select distribution profiles as shown in image.

Provisioning profile issue in Xcode 7.1.1?

Earlier I was using Xcode 7 it used to show me the provisioning profile for the IPA file which I selected under build settings. But now after update to 7.1.1 whenever I make IPA file then it always show me iOS Team provisioning under provisioning profile section even I have selected the correct provisioning profile.
See screenshot:
Please tell me how to resolve the issue.
Edit:
In iOS Team Provisioning profile all the UDIDs are added which were previously added by me on developer account.
In developer.apple.com:
Go to Certificates, Identifiers & Profiles > Provisioning Profiles
Delete any provisioning profiles that are no longer needed.
Pay careful attention to those that match your app's bundle ID, for example, com.yourdomain.yourappname.
Make sure you have at most one provisioning profile for Development and at most one provisioning profile for Distribution.
Download each provisioning profile and double-click on it in Finder so that it gets installed.
In Xcode:
Go to Your Target > Build Settings > Code Signing
Set all values to be iOS Developer.
Go to Your Target > Build Settings > Provisioning Profile
Set all values to be Automatic.
In Xcode:
To test the changes, create an archive using Product > Archive.
After the archive is built, open the Window > Organizer and Export the archive.
Choose Developer Deployment.
Choose your team.
The provisioning profile display should now be correct for your app in the Summary window, the one that you have shown in your question.
Please follow the steps.
1.Open Xcode
2. then goto Xcode section
3. Select Preferences
4. Account
5. Select your account details
6. Click View Detail
7 .Sync details.

XCode 6 and Ad-Hoc distribution without XC: provisioning

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.

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

Cannot add distribution provisioning profile to Xcode 5

I'm trying to distribute my Phonegap app on the iTunes. I have done this before successfully before but I have since changed to a new Mac. I'm using Xcode 5.0.2.
I have created development and distribution certificates. I then created an App ID, entering the Bundle ID under "Explicit App ID".
I then created a development provisioning profile for the app, choosing the correct App I.D., the iOS Development certificate, my device, giving the profile a name and clicking "generate". I download it and double click to add to xcode. The xcode organiser opens and I see it added under my device provisioning profiles. I can then successfully run the app on my physical device.
Now I want to distribute it. I created a new provisioning profle, selecting "App Store" under Distribution, selecting the correct App I.D., the iOS Distribution certificate, and clicking "generate". When I double click the downloaded file, the organiser in xcode opens, but the distribution provisioning profile doesn't under the device provisioning profiles. When I click the + button to add the profile, I cannot select the Distribution provisioning profile, but I can select the Development provisioning profile:
I have no idea why this is. I tried closing down and opening xcode, to no avail. I tried waiting a few hours. Again, it didnt work.
I then try to distribute my app by creating an archive. First I go to build settings > code signing and choose iPhone Distribution:
I then select my physical device and choose Product > Archive. I get the error:
No matching provisioning profiles found
None of the valid provisioning profiles include the device Belgian Iphone (identifier: xxxxxxxxxxxxxxxxxxxxxxx).
Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.
I click "Fix Issue" and end up with the error:
There was an error generating the team provisioning profile for AppID 'FT49U8Q9JE'.
The AppID given here is different to the prefix in App ID's in the developer portal. I don't know if it should be the same. Any suggestion? I have spent 3 days on this problem and as stated above, I had no issues on my previous mac (which I no longer have)!
Something that got me recently was having to actually set the provisioning profile in the build settings

Resources