Can't use the iOS distribution in Xcode - ios

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.

Related

Xcode 6 error when building app for release

I am having issues trying to achieve or even build a release build of an app I am working on. Whenever I try to build the app for release I get an error saying:
No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.
I have the cert for this profile on my computer but in the Developer Portal I only have a certificate for development. Is this causing this error to occur? Do I need to have a Distribution cert to be able to build for release? Any help would be appreciated.
Note: I am a developer(team member) for a company so I do not have direct access to the Apple Developer Portal.
I know provisioning profiles are a pain :) This is what I do to stay organize and develop/distribute my projects:
The developer portal (not xcode) contains the most accurate source of profiles. For example, imagine you created a merchant certificate, turned on apple pay, and then generated a provisioning profile. Then let's say you decide you no longer want to use apple pay - the act of turning it off actually invalidates the provisioning profile. You will see a yellow "invalid" warning in the developer portal, but the provisioning profile may still be available in xcode! Really annoying. So I would always make sure that your provisioning profile is valid in the developer profile before distributing an app.
In the developer portal, always make sure you have two distribution profiles -- one ad hoc to use with testflight, and one to distribute to the apple store. You should also have one developer profile to build and debug your code.
Once you have your profiles set up, go into xcode and refresh the provisioning profiles as described here: https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26. I.e. go to preferences, accounts, view details..., and click the refresh button on the bottom left hand corner.
Now that xcode's provisioning profiles are updated, you need to now code sign with the right profiles. To do so, go into your project settings, and go into build settings for both the project and the target. Under debug, select your iOS development certificate. Under release, select your iOS distribution certificate. Under provisioning profile, you will want to select your development profile just to build on your device and debug, your ad hoc distribution profile if you want to archive the project and send it via testflight, or your apple store distribution profile if you want to archive the project and submit it to the apple store.
A few things to note, is that when you are creating the provisioning profiles, you need to specify the certificate you are dealing with. So if you are creating one of the two distribution profiles, you will need to select your iOS distribution certificate. And when you select ad hoc distribution, will need to select the devices that you want to be able to distribute too. Testflight will help you register the devices that you want to distribute to, and once registered, you will be able to select those devices to add them to the provisioning profile. If the certificate you select in xcode was not used to generate the provisioning profile you selected in xcode, then you will probably get the error you mentioned. Think of the provisioning profile as the link from you as a developer (i.e. your certificate) and/or your devices to your app id (i.e. your project).

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.

Xcode - code signing identity automatic?

What's the meaning of the Automatic code signing identity in Xcode 5 under the build settings tab? When I pick iOS Developer, both Debug and Release use it. What should I use? Will I be able to distribute app with the iPhone Developer identity for relase?
My provisioning profiles (the setting under) are correctly set (Debug use Team provisioning profile and Release use my ad-hoc profile), what's different between the code signing identity setting and the provisioning profile one?
Here's some screenshots of what I'm talking about:
Also, When I put Automatic to both Debug and Release, it marks it as Don't code sign, why?
Edit:
Is iPhone Developer also valid for release? should I select Automatic/iPhone Distribution?
As you can see, i'm pretty confuse about all the settings Xcode propose with code signing identity, so any clarification about each one is welcomed, thanks!
The automatic setting should automatically use the correct certificate to sign your app with based on the provisioning profile set in the bottom option in the Code Signing section. You can explicitly set both the Code Signing Identity as well as the Provisioning Profile, or set the Code Signing Identity to Automatic. If you select Automatic, Xcode will automatically use the certificate associated with the provisioning profile.
For example, if the Debug provisioning profile is a development profile, and the Release provisioning profile is set to an ad hoc profile, when you Build and Run (which typically uses the Debug configuration), Xcode will sign your app with the Development certificate associated with the development profile. If you Archive your application (which typically uses the Release configuration), Xcode will sign your app with the Distribution certificate associated with the Ad Hoc profile.
Basically, it's just a way to let Xcode decide which certificate should be used based on the Provisioning Profile.
The last line in the "Setting the Code Signing Identity Build Setting" section here alludes to this but isn't overly explicit.
Set the Provisioning Profile build setting to your development profile
and the Code Signing Identity build setting to your development
certificate.
The main idea behind Code Signing is to certify that an app was created by you and easily detect any changes in your app. So, after you choose a Provisioning Profile, Xcode automatically sets the Code Signing Identity build setting to “iPhone Developer” for iOS apps. It just works fine, your app is code signed the next time you build it.
This thread answers your specific question with screenshots.
Apple documentation also suggests that -
If necessary, from the Code Signing Identity pop-up menu, choose your
development certificate.
For iOS apps, choose the certificate in the provisioning profile menu
item that begins with the text “iPhone Developer:” followed by your
name.
About Automatic Profile Selector, this is what Apple documentation says -
Your Provisioning Profile or Signing Identity Doesn’t Appear in Xcode
Menus Occasionally, your provisioning profile or signing identity
doesn’t appear in a Provisioning Profile or Signing Identity pop-up
menu when distributing your app using the Devices organizer or when
setting the Code Signing Identity build setting in the project editor.
When this occurs, refresh provisioning profiles in Xcode, as described
in “Refreshing Provisioning Profiles in Xcode.”
If your provisioning profile still doesn’t appear in the Code Signing
Identity build setting menu, choose Don’t Code Sign or a certificate
under Automatic Profile Selector from the Code Signing Identity menu.
The next time you choose the Code Signing Identity menu, your
provisioning profile should appear in the menu.

XCode doesn't honor the "iOS Distribution" Code Signing Entity setting

I want correctly understand the Code Signing Identity setting: I want to use the automatic setting in Xcode and not specify a specific identity. The automatic setting has 2 choices: iOS Developer and iOS Distribution. Based on which one you use, it's supposed to switch to choose a developer or a distribution signing identity from your keychain.
I have my build settings configured as follow, in order to use an "iOS Distribution" identity on build:
When I Archive my app (the Archive scheme is correctly set to use the Release build configuration), I see that Xcode is not using the correct code signing identity:
Anyone would know why this is the case? I'm looking for an explanation and not a workaround solution (I know I can work around the problem by directly setting the Code Signing Identity to my iPhone Distribution: Company Name identity from the keychain)
Thanks!
So interestingly this doesn't actually matter in the latest Xcode as long as the profile you are eventually going to sign with is for the same bundle identifier as the one its signing with now...
As long as the team setting is set Xcode is capable of generating the profile you need automatically. Don't try to fight it.
Here is the Team setting from the Target's General settings screen:
Then when you archive Xcode puts the archive in the organiser. When you click distribute on the archive in the organiser window it prompts you to select a new signing identity and actually re-signs the app.
It actually works to sign apps with the team provisioning profiles generated by Xcode. You also don't need to make an ad-hoc specific provisioning profile as your testers can now install apps signed using the development provisioning profiles with no issues. The only time you will need to make your own provisioning profile is if you are using any of the concrete bundle id features like push notifications, game centre, data protection, iCloud, inter-app audio, passbook, keychain access groups or in-app purchase.
If you make your own provisioning profiles for specific bundle ids then Xcode will either automatically select, or have available for selection, the relevant provisioning profile at the point of choosing the identity in the organiser window.
You can refresh Xcode's cache of provisioning profiles from the Accounts pane of Xcode's settings. Click on your team, Click "View Details" and then click the tiny refresh button in the bottom left corner

Is it any option to disable auto generate provisioning profile from Xcode 5.0.2?

I am using Xcode 5.0.2 and developing ios 7 Application with Push notification service.When I try to create a Push Notification service enabled Provisioning Profile in Dev center,I have seen lot of Provisioning profiles created with message as "ios Team Development provisioning profile(Managed by Xcode)".
I want to develop my application using my Push notification enabled provisioning profile only. But I didn't get any option to select this particular provisioning profile.In build settings, I able to select only my Apple ID only. If I select this it selects "ios Team Development provisioning profile(Managed by Xcode)" only not my push enabled provisioning profile. Is it any option to disable auto generate provisioning profile from Xcode?
As to me, I simply choose 'Team' of my Apple ID in 'General' tab, and everything is done if proper APNS certificates are set in dev center, because Xcode 5 is really smart.
IIRC, earlier versions of Xcode used to let you select your provisioning profile in the build settings under Code Signing Identity. Now you select your provisioning profile under a separate build setting called Provisioning Profile, and once that is selected, you can select your developer certificate under Code Signing Identity. This part is more intuitive than the old way, if you know the new setting is there.
If your desired provisioning profile isn't available under the Provisioning Profile build setting, then you have to go to Xcode > Preferences > Accounts > [account name] > View Details and click the Refresh button under the Provisioning Profiles list. That should download your current profiles so you can select them in the build settings. This part is totally unintuitive and hidden. But one thing is for sure ... after you've done it enough times that it becomes intuitive, Apple will change it again!

Resources