Never know which profile(s) combination to sign with - ios

I never know which profiles I am supposed to be signing a build and signing a release for ad-hoc distribution with.
I've tried signing the build with the ad-hoc distribution profile and then the package with the push profile but that didn't work, so just tried many combinations until I hit one that worked.
Yesterday after months of hassle-free operation regarding signing I had to re-install XCode after it kept crashing and then I could no longer sign for development on my own phone nor for ad-hoc distribution onto other's phones.
I tried dozens of combinations of different profiles until eventually I got an ad-hoc release that I could install on somebody else's phone, but then XCode crashed again and I've lost what that combination was, making me want to cry, and I don't want to go through that process of trying all possible combinations again.
Within XCode in the Code Signing Identity section I have the following choices:
a) Apple Push Profile
b) iOS Team Provisioning Profile
c) NNN Development Profile, where NNN is the name of the project/product being developed
d) iPhone Distribution Company Name which is described as an identity without provisioning profiles.
e) ad hoc distribtion
Which of these 5 above should I be using to sign a build to run on my own device using XCode? Do I need to change it to ad-hoc distribtion when building to send a package to others to install via itunes?
Secondly, once I've built an archive and want to create an ad-hoc deployment to send it to testers for them to install via iTunes, there is the additional step of signing the built package, for this I am offered the following choices:
1) Apple Push Profile
2) NNN Development Profile
3) iOS Team provisioning Profile
Which of these 3 should be used to sign the ad-hoc deployment.
Thank you very much.

I have 4 provisioning profiles for my apps.
One is the iOS Team provisioning profile supplied by Xcode
The other 3 I've generated via the Apple iOS Provisioning Portal.
1 development profile that is general for my company:BlahBlah.com.myCompany.*
1 adhoc distribution profile that is also general for my company:differentBlaBlah.com.myCompany.*
1 Distirubution profile that is product-specific: BlahBlah.com.myCompany.NNN
When I test on my machine, I use the Xcode-generated one. When I run it on my devices, I use the dev. profile. When I build for distribution to testers, I use the adhoc. When I upload to iTunes, the 3rd.
No entitlements anywhere.
HTH!
Janene

Related

Installing a Distribution Certificate signed iOS app through Xcode?

Is it possible to install and run a build on iPhone through Xcode by manually signing it with a distribution certificate? I tried doing the same, but it says:
A valid provisioning profile for this executable was not found
Is this some error that can be taken care of, like is there something problematic with the provisioning profile itself or it isn't possible at all?
Also, just in case it is possible, would that allow me to test the app as if I am doing it in production, like using IAP etc in real production environment?
If you want to install Application with Distribution certificate than there are 2 options available
1. With Xcode :
There are 2 different types of Provisioning Profiles available in Distribution (AdHoc & AppStore)
If you are going to install directly with Xcode than you can make AdHoc Distribution Profile & add your Device Id in It & install it via Xcode
Make sure you won't be able to debug with this Provisioning
2. With TestFlight :
Second option is you can use Apples TestFlight beta program to install App through App Store Distribution App
For that you need to upload application on App Store same as we are uploading live apps.
Than go to the Beta testing section & Invite the beta testers
Hope this helps to everyone.

APN & TestFlight : Xcode chooses a wrong (XC*) provisioning profile to submit archive

I am using Parse.com to send client push notifications, from one iDevice to another.
It works well with the 'development' setup, i.e. with
- the Push Notification Setting of the appID set on 'Development'
- a development SSL certificate
- a development provisioning profile
With this setup, I managed to send a push notification to myself (sender = receiver = my device).
Now I want to test the communication between 2 different devices. To do so, I use TestFlight (because this is the way I usually send updates to my client).
I followed all the recommended steps to move from Development to Ad Hoc :
updated AppID settings to 'Production' Push Notifications
created a production SSL certificate, uploaded it to Parse Server
generated a new Provisioning Profile set for Ad Hoc Development, and installed it on the iPhone (checked on Organizer Library). This Ad Hoc Provisioning Profile is named : 'PushMyMoving_Push_Production_Profile'
updated the Project/Target build settings under 'Code Signing' to tell Xcode that it should use PushMyMoving_Push_Production_Profile (and the corresponding iPhone Distribution Certificate) for now on.
The issue : the build is successfully submitted, but as soon as it is, Apple sends me this e-mail :
And, naturally, I can no longer receive/send push notifications. Here's what I tried so far :
I opened the PushMyMoving_Push_Production_Profile to see if the Push Notification Entitlement was missing. It isn't. So my guess is that Xcode doesn't submit/archive the build with the right Provisioning Profile, although I'm telling it to do so in the Build Settings!
Actually, I noticed that whenever I submit the build, Xcode automatically selects a wildcard provisioning profile :
I tried to delete all the wildcard provisioning profile from Member Center & my Mac, but (annoyingly!) Xcode automatically re-creates them whenever I refresh the Provisioning Profiles Panel under Xcode>Preferences>Accounts. Is there a way to completely erase wildcard profiles ?
This thread : XCode 6 and Ad-Hoc distribution without XC: provisioning suggests that it can be that the "ad-hoc profile doesn't contain all of the devices on your team" but I carefully checked ALL the devices I have when I generated the Ad Hoc profile.
I've also tried to edit & re-generate, re-install the provisioning profile (a common advice apparently) but Xcode still does it its way.
Any help would be much appreciated! I have been struggling for days, it is really frustrating when the problem does not come from the code !
Thanks
Thanks Rhythmic Fistman for the help. I found the answer today : I was submitting my build to TestFlight with an Ad-Hoc provisioning profile, instead of an AppStore Distribution Provisioning Profile. I had read somewhere that Xcode was creating a Ad-Hoc provisioning profile behind the scenes while submitting to TestFlight, so I thought that the Ad-Hoc profile was appropriate. But since TestFlight runs like the AppStore, not having registered the subscribed devices UDID in advance (as with Ad-Hoc distribution) it makes sense to use a "broader" profile such as an AppStore Distribution Provisioning Profile.
So for anyone using Push Notifications with Testflight, you do need an AppStore Distribution Provisioning Profile. Then Xcode will automatically picks it for the submission phase.
Expunging wildcard provisioning profiles from Xcode and the developer portal can be done, but you can probably fix your problems by explicitly setting your Release Provisioning Profile to the correct Ad Hoc profile in your build settings:
This should stop Xcode getting too creative when Archiving.

Xcode 5 crashing when trying to validate archives

I had a couple questions when trying to put an app on the app store.
1) With Xcode 5 when trying to validate the archived project, Xcode 5 keeps crashing when trying to download the provisioning profile from the net. I have refreshed the provisioning profiles using the Preferences >> Accounts >> View Details and have clicked the refresh button but it still crashes when I try to validate.
2) Is it best practice to have a separate distribution certificates and provisioning profiles for each app you put on the app store? right now I have a separate provision profile for my apps but they are under one certificate. Can you guys tell me what the best practice is?
3) And can you try to explain what the certificates and the provision profiles are doing? Also, what would the difference between distribution provision profiles and development provisioning profiles.
1) - Check what version of Xcode you're running. I had a similar issue where I was running a developer preview - you can't submit an app from a DP version of Xcode, and mine was crashing at the exact same point as yours.
2) - Having 2 certificates - 1 for dev, 1 for distribution seems to be the norm. I would suggest that you use explicit app ids and not the wildcard ID when you go to create your App ID though.
3) The way I see it, Provisioning profiles are your wrappers for your different things that make it up - mainly the signing certificate, the app id and the device id(s) - You select either a distribution or a dev signing certificate to determine if the app is being developed or submitted to the app store. You select the App ID to tell the app what functions it will have (iCloud, Data protection, etc) and what teams can work on the app. The Devices are what UDIDs are authorised to run this app that has this associated provisioning profile. The provisioning profile is how it's all packaged up.
As another way to look at it, You have your .ipa file (your app) and your provisioning profile. The device looks at the profile, checks if the devices UDID is present in the provisioning profile, checks the App ID to see what features it's allowed to run, and the certificate is used to sign it all off.
Hope this helps.

Which profiles to choose for Code Signing Identity versus signing for distribution versus Code Signing Entitlements

I have read the Apple documentation, and many postings on the subject on SO, along with various tutorials, and yet I have to admit I don't 100% understand what profiles to use when and how, and usually resort to trial and error until I find a combination that works.
However at the moment I'm in the situation that an ad-hoc app (that used to install) via iTunes now no longer does either on my phone or on tester's phones, though it will install using XCode. The error message on the phone is juts "ZZZ failed to install.".
I have the following profiles installed in XCode:
1) Ad-hoc distribution profile
2) Team provisioning profile
3) Development profile
4) Apple Push Profile
Some questions:
1) Which profile should I use in the Code Signing Identity section of the Target Build Settings and why?
2) Which profile should I use when distributing an Ad-Hoc Deployment?
I would assume for 2) it should be the Ad-hoc distribution profile? If not what/when should that profile be used?
If the Ad-Hoc distribution profile is used in step 2) then I guess I have to use the Apple Push Profile in step 1)? Otherwise how can I receive APNs?
When then should I be using the other profiles?
A few follow up questions:
3) In what circumstances would or should you set a different code signing identity in the Project to the Target?
4) By default there are 5 sections in the Code Signing Identity (Code Signing Identity, Debug, Debug Any iOS SDK, Release, Release Any iOS SDK). In general should these all be the same? Under what circumstances would or should they be different?
5) What is the Code Signing Entitlements section used for?
I've been working with iOS development for quite a while, and would consider myself advanced in many areas, but this one just does my head in.
Many thanks if somebody can demystify this.
1) Development profile, must be generated after APNS profile. You don't sign bundles with APNS certificate, it is for server. But in you development and ad-hoc profile will be part with info about Push Notifications, so you need to re-creare dev and ad-hoc profiles after changes in APNS settings in provisioning portal. For proper usage of APNS you should read additional materials, like that or any other. If app has no APNS, you can use team provisioning profile with your developer name for debugging as well.
2) Yep, Ad-hoc.
3) If you have more then one target in the project
4) I used development profile as "Debug" (same in "Debug Any iOS SDK") and ad-Hoc profile as "Release" (same in "Release Any iOS SDK)".
Welcome to crazy world of app signing!

How to know which distribution/development provisioning profile my app is using

Currently in development and testing phase, in order to distribute my app amoung test team I created multiple provisioning profiles and somehow managed to run my app on different devices for testing, now I want to know which provisioning profile my app is actually using? and from which certificate my app is signed?
Click the name of the app in the tree on the left. Then: Build Settings/Code Signing Identity

Resources