Profiling Vs Archiving - different code signing requirements? - ios

In XCode5, is it still the case that if you want to profile a release build of your app, then archive it for distribution, you have to manually change the provisioning profiles in build settings? That's how I remember it being in XCode4 - building with a distribution provisioning profile means XCode can't hook the process on the device.

If you archive an application it is signed with the provision profile that you have indicated to use under its build configuration.
An archived app can be resigned with a different provision profile at a later time (though the organizer or command line), so in a way, they are independent of provision profile.

building with a distribution provisioning profile means XCode can't hook the process on the device.
If you build for distribution through the App Store, the program won't run at all until it has been signed by Apple. So yes, you'd still need to change the provision profile in order to run the app so that you can profile it.

Related

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.

iOS: Is a Distribution build supposed to work on my Developer device?

I am confused with profiles and certificates for the build I am trying to put on the Appstore.
In developer.apple.com/ I have properly created both a developer and distribution certificate. they are both linked to the single app I have created.
I have registered my device (iphone)
I also have properly created 1 development provisioning profile and 1 distribution provisioning profile.
When I build with dev certificate + dev provisioning profile: app works fine on my device
But I know the build needs a distribution certif and provisioning profile in order to get approved on the appstore.
However when I build with distribution certificate + distribution provisioning profile, the build is succesful, but I can't launch the app on my iphone, other iphone (with http://www.diawi.com/ or iTunes). It immediately crashes with the infamous error popup: "unable to download. "XXX" could not be installed at this time".
When I look at the device's log from Xcode, it clearly states the crash comes from a profile issue.
Is the distribution build supposed to work on my iPhone?
You can check you Beta release build to your developer device using 'Apple Ad Hoc Distribution profile/certificat'. Here are Apple Dev link Beta Testing Your iOS App
No. A distribution build will not just be installable on your device. You are meant to submit it to iTunes Connect from Xcode, where you build it from an archive, or from Application Launcher where you would submit it as an IPA.
you should have created adhoc distributed provisioning profile and add your device to that profile.
But you need iTunes Connect to submit the app to App Store. This time you can create provisioning profile for app store.
Advantages of iTunesConnect.
1. You need not to add new device to the provisioning profile every
time you want to test the app in new device.
2. You can add as many as new test users to the app and can mark them as internal and external users.
3. You can upload as many builds as you want and test those builds.

XCode--When do I sign with developer provisioning profile vs distribution profile?

I am trying to prepare my app in Xcode 4.6 for enterprise deployment. I am getting this error: "failed to get the task for process 5057".
Under the project's build settings' Code signing identity section, I have selected the iPhone Distribution provisioning profile that I made for my app (it is valid). I did not select the development provisioning profile as my identity, b/c I'm trying enterprise distribution.
But of course, I get the error "failed to get task for process 5057". Why am I getting this error? I know that the fix is to use the development provisioning profile, but why--I want to prepare my app for distribution.
Should I have two schemes for my app, one for development and one for release? And inside the dev scheme, I use my dev provisioning profile and inside my release build settings, I use my distribution provisioning profile?
XCode has made this very confusing.
Failed to get task sounds like you're trying to run this build via Xcode on device. If that's the case, you want to use a development profile, not a distribution profile (AdHoc). If you're attempting to create an enterprise release build, you'll want to select your target and choose the iOS device option, then use Product > Archive to create a release build.

Never know which profile(s) combination to sign with

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

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