Regarding using same distribution provisioning profiles for IOS in two MACs - ios

I have set up a distribution profile for my IOS App. On Mac A, in Xcode this profile can be perfectly imported and used even the right distribution certificate is used. and now I can successfully upload app to app store via MAC A.
I have added distribution certificate in MAC A's keychain and then i exported certificated from it. Later I imported it to MAC B's keychain.
Now on another machine MAC B, if i import the same provisioning profile in XCode, it doesn't recognises distribution certificate.
Can someone throw some light on this whats going on here ?

Based on your information, you have only imported the certificate to Mac B. In order to use that certificate to actually sign a binary, you will need to export the private key from Mac A. You will find it in the Keychain Access app on Mac A. Find the iOS Distribution certificate in the Keychain and you should be able to expand it to see the private key (note that you will not be able to expand the certificate in the Keychain app on Mac B). See this answer for details about how it should look in on a Mac that is setup to allow for code signing.
Once you find the private key, you can export the private key from Mac A by right clicking it and choosing export. Save the .p12 file and then copy that .p12 file to Mac B. Open the file to import it to the Keychain. Once you ahve done that, you should now see the private key under the certificate on Mac B. If you don't, you have the wrong certificate on Mac B and you should delete it and export the certificate from Mac A to import on Mac B.

There are couple of factors which affects your Distribution Provisioning Profile, to find the issue you can check couple of things like
Check in you MacB's Keychain > Certificate section about Distribution certificate is valid which you have installed from MacA?
Does there is any expired certificate from same or different account in your keychain which is situated/placed above your Distribution certificate, because many times XCode fails to validate your desired certificate from Keychain due to some expired certificates entries above your certificate. So if any then please remove it.
Try removing all provisioning profiles, then again install latest one. And finally try quit XCode completely and relaunch it. Many times this steps will solve issues regarding Provisioning profiles.

Related

iOS Distribution certificate

I am having a problem with Xcode and the iOS Distribution certificate.
When I try to validate an archive, I get the message that there already is a valid distribution certificate but that it is not installed. My signing identity is also installed altho the message says it is not. I have no idea how this is possible since I have published apps to the app store before without any problems.
Anyone who knows how to fix this?
Xcode version 6.4
I solved it by doing this:
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
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
Run your app, Archive it, then export the archive.
And viola
This took me days if not weeks to figure out, I hope it helps you.
The problem is the distribution certificate was installed in another mac.
You can:
Export it from that mac and import to your Xcode.
Go to apple developer website, revoke current distribution certificate. Then open Xcode get new distribution certificate for your mac.

Do the distribution profiles come from distribution certificate?

The client has given me the distribution profiles, how can i add the profiles in xcode 5?
As far as i know distribution certificates are responsible for distribution profiles. Importing distribution certificate enables and add all the distribution profiles in xcode. Without certificate distribution profiles can't be used.
Please correct me if i am wrong and suggest the work around for importing profiles in xcode 5.
Deployment phase is new for me.
Thanks
Importing the profiles is just double clicking on them. You can't use the profile without the private key for the certificate that was used to generate the profiles. This need to be exported from the keychain (usually as a p12 file) and imported onto your development machine.
It is possible that the client exported a package containing all of this info using Xcode, then double clicking should install everything required.
Importing distribution certificate enables and add all the distribution profiles in xcode
No, importing one doesn't automatically import the other.
There are no workarounds, you need to be supplied with both the certificate (private key) and the profiles.
A distribution profile is basically a way to make a trust relationship between a particular distribution certificate (which identifies your organisation as a registered Apple development organisation), a particular app or group of apps (identified by an AppID like com.foo.bar.myawesomegame), a set of valid devices where the app can be installed (in the case of ad-hoc distribution; in the case of App Store distribution this is not required), and a set of enabled services, like In-App Purchases.
In your particular situation, if the client wants to test your app, and you are provided with a valid distribution provisioning profile (a file with .mobileprovisioning extension), you also need to install a valid distribution certificate on your computer. The client can download this certificate from http://developer.apple.com (Member Center) and send it to you so you can import it on your machine with a double click on the .cer file.
To enable external users test an app, there's a simpler process, providing that your organisation is a registered Apple development organisation: First, you generate a distribution certificate from http://developer.apple.com. Then, you create a distribution (ad-hoc) provisioning profile and add the distribution certificate and the UUIDs of the iPhones the client wants to use for testing. The client can get the UUIDs from the iTunes app, for example. Then, you can download both the certificate and the distribution profile to your computer, double click to import them into Xcode, and finally sign the app (.ipa file) so that the client can test it on their own devices. You can do that by choosing Product, Archive in Xcode and selecting your distribution certificate and provisioning profile.

Transferring Apple dev account & certificate to new machine

I've recently attempted to transfer my apple dev certificate to a new mac, however, the provisioning profiles are appearing as valid signing identity not found.
I imported my developer account into Xcode5 and when I deploy a build, I get the option to fix the issue of not having a valid signing - this generates an iOS team provisioning profile for the bundle id.
So far have found this is fine for testing - we distribute ourselves not using the app store.
If anyone would be able to give me a heads up on whether this is an okay method, or whether I will need to generate a new certificate for distribution in case we do use the app store for distribution.
If you still have access to your previous computer, you can export as p12 the private key you used to generate the Apple certificate.
Go to keychain, select the iOS certificate and right click to export it. Then import it to your new computer and you do not need to generate new certificates.
what you need to do is to remake the developer and distribution certificates for your new mac and install it then, you update your provision profile with the new certificate, reinstall it and everything works
PS: for remake your developer and distribution certificates you have to go in the keychan
Certificate Assistant > Request a Certificate From a Certificate Authority..
then add your email and common Name, check Saved to disk. Finally Into the developer web site you remove your old certificates and create the new one with the new file that you have in the disk.
Did you export from Xcode → Preferences → Accounts like Apple's guide suggests?
Did you also export your private key from the keychain? I have seen this issue before, and that was resolved by exporting and importing the private key.
If you do want to distribute on App Store later on you will definitely need to import a valid certificate, yes.
here you can find a solution or ask your problem to a developers Apple support:
https://developer.apple.com/support/
Other way you can call the developer support center here:
https://developer.apple.com/contact/phone.php

IOS: problem with certificate

I used a mac at work where I created .ipa without problems and I tried my app on device.
Now at home (in another mac) when I choose device on my project and I do "build" I have an error:
Code Signing Identity 'iPhone Developer
does not match any valid, non-expired, code-signing certificate in your keychain
why?
I had the same issue. You need to export your certificates and profiles from your mac at work, and import them at home. It is really annoying, you can just download the certificates and profiles to one mac, it wont work if you download then again onto another mac, after having them already used on another machine. If you are having issues exporting and importing profiles, then you can google for some tutorials.
On your mac at work, you've added the code-signing certificate to your keychain. You need to do the same for your mac at home. You can download the certificate from the developer portal, same as you did for your work computer.

iPhone: Can a dev other than team agent build an app for distribution

I have a company iphone dev account.
According to the doc, only the team-agent is allowed to submit a distribution cert and download the distribution provisioning profile.
Can a team only have 1 Team Agent?
Also, if that is the case, is there a way around this to allow multiple devs the option to build a distributed version of the app?
I have another developer who I would like to build and submit the app to itunes. I tried giving him the distribution cert and distribution profile. When he dragged and dropped them into xcode, and checked out windows->organize, it complains
"assigning identity matching this profile cannot be found in your keychain"
So this leads me to believe I need to get my key chain credentials on his machine. I tried exporting a private key and giving it to him, but he was unable to install it.
Is there anything else I can do?
I honestly thing its really silly if apple expects one developer to be responsible for building all apps for a company. Hopefully I'm wrong and there is a way to get multiple developers access to building a distribution of an app.
Thank you
NOTE: This process is heavily simplified in XCode 4 (although not personally tested by me) with importing and exporting of developer profiles through the Organizer window (Developer Profile section).
This is how I got it working.
1) Login to the iOS Provisioning Portal as the Agent.
2) Run through the process of making the Distribution Certificate Signing Request / Provisioning Profile: http://developer.apple.com/iphone/manage/distribution/index.action. These instructions a re super long, but pretty clear and necessary.
3) Pay extra attention to the section "Obtaining your iOS Distribution Certificate" > "Saving your Private Key and Transferring to Other Systems" on that page. It describes how to generate and save the Agent's .p12 file.
4) Now invite other developer(s) to be part of the team in the Member Center: https://developer.apple.com/membercenter/index.action#invitations
5) Back in the iOS Provisioning Portal, download the app's Distribution Certificate (Certificates > Distribution (tab)). Should be named "distribution_identity.cer"
6) Now download the Distribution Provisioning Profile (Provisioning > Distribution (tab)). Should be named "whatever_you_named_it.mobileprovision"
7) Email those two files along with the Agent's .p12 file to your other developer machine.
8) On the developer's machine, double-click the distribution_identity.cer file and it should load up in Keychain Access
9) Drag the .p12 file to Keychain and it should automatically put the identity under the certificate
10) Drag the whatever_you_named_it.mobileprovision file into XCode.
11) In each of the Project and Build's Info windows, set the Code Signing Identity to the "iPhone Distribution - Your Company" identity which should now be available.
Hope that helps. Rob
Just another tutorial step by step, but slightly different, the certificates have been already installed in the team's agent keychain, so it explains how to export the .p12 files from the keychain:
how-to-share-an-ios-distribution-certificate
You definitely should be able to build your app with a distribution certificate and profile on your coworker's machine.
Are you sure that the distribution certificate and provisioning profile are installed correctly? If you can build apps with the development certificate but not the deployment one, check to make sure that everything's properly installed in the keychain and that the correct provisioning profile is selected in the settings for the active target.
You can copy the private key in this way, but it's really UNSAFE:
Give him your login.keychain file (located in ~/Library/Keychains/), and let him open it with Keychain.app, and ask him to drag your private key to his login.keychain.
Apple also said you should keep your private key secured, if you need to reinstall your system, make sure you backup the login.keychain file.

Resources