How come I can install an app store distribution build directly on my device? - ios

I was under the impression that it was impossible to install an app store distribution build directly on a test device (without going through the actual App Store). I found multiple references to the following note by Apple (though I could not find the note itself in the current version of the iOS App Distribution Guide):
"App Store provisioning profiles do not allow for a distribution built application to be installed on an Apple device. To install your distribution ready application on a device, you must create an Ad Hoc provisioning profile."
Now consider the following: I have an Ad Hoc Distribution provisioning profile and an App Store Distribution provisioning profile. The ad hoc profile contains a list of provisioned devices, the app store profile doesn't. My (no jailbrake) device is included in the provisioned devices in the ad hoc profile. My build was signed with the app store profile. The resulting .ipa file was submitted to the App Store (and approved - but it is not publicly available yet). When I view the package contents of the .ipa file, I see that the embedded.mobileprovision is indeed the app store profile (without the provisioned devices list). When I drag this profile to my Xcode Organizer, I get an error that the profile cannot be installed because the device is not included in the profile (as expected). However, when I drag the .ipa file to my Xcode Organizer, the app installs on the device (and can be opened on the device afterwards). I tried this after making sure there were no other copies of the same app installed on the device. The same thing does not work when I use a different device that is not included in the provisioned devices of the ad hoc profile (even though the .ipa contains the app store profile without provisioned devices list).
Does anyone have a possible explanation for this? It seems that somehow a build signed with an app store profile can still be installed on a device included in the corresponding (same app identifier? same team identifier?) ad hoc profile. But if this would be the case, what is the point of making separate ad hoc builds?

I noticed this too and always meant to find out why it worked.
It used to be true that you couldn’t install an App Store build but that appears to have changed, I’m guessing either in iOS6 or 5.
I found that I could only install App Store provisioning profile builds when a compatible Ad Hoc profile was already installed. Developer profiles did not work. I did not try wildcard profiles. So it looks like the Ad Hoc rules changed.
I can’t find the rules for installing an Ad Hoc build, but on the topic of launching the “Ad Hoc Provisioning Profiles in Depth” section of Apple’s App Distribution Guide says that
The app successfully launches if the app’s bundle ID matches the App ID, the signature matches the distribution certificate, and the device is in the device list of the ad hoc provisioning profile.
So I guess technically an AppStore builds meet these Ad Hoc requirements because it too is signed with the same distribution certificate. The use of “the” is misleading here because it makes it sound like iOS consults your embedded.mobileprovision, which is untrue. It should read “an” ad hoc profile.
NB: The install only worked when the Ad Hoc profile was already installed on the device, so that’s one reason to make separate ad hoc builds.
NB: This is all conjecture, another explanation could be that Xcode handles the installation of the embedded.mobileprovision and now continues when the AppStore profile installation fails.
This raises another question for me: why does iOS DWIM for App Store builds yet refuses to launch Ad Hoc builds with expired provisioning profiles when a perfectly valid replacement is installed?

Related

What is difference between Xcode Ad Hoc and IOS Team Provisionig Profile

I am not sure what is the difference between these two XC Ad Hoc and iOS Team Provisionig Profile. These two are generated by Xcode.
Are these two same?
OR
If different what's difference between them and when to use which one?
As far as I understand and searched the forum what I got is this
Development profile allows you to test your apps on your physical devices
App Store Distribution profile allows you to sign your apps for App Store distribution
Ad Hoc Distribution profile allows you to sign your apps for Ad Hoc distribution
Mainly AdHoc distribution allows you to install the generated IPA on
100 devices which you can distribute for testing.This 100 devices
should be added in your developer account.
AdHoc distribution is used for testing production push notifications
in the app. Before releasing the app to appstore, if you want test
your production push notifications you need to generate ipa and test
the notifications.
Ad Hoc Distribution Profile: Using this profile you can allow 100 devices to install your app for testing purpose. App signed using this profile can be install using itunes. App must have same identifier as mentioned in Ad Hoc provision profile. ie. com.yourName.appName
iOS Development Provision Profile: You can install your app directly from XCode to test on device. It is not compulsory to have matching identifier for app and provision profile if provision profile is signed with wild card. ie. com.yourName.*

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.

How come I can install app store profile signed application on my device?

As per my understanding, to create an IPA for distribution for testing or sharing with others, I need to sign my application with AdHoc profile. For uploading the IPA to App Store, I need to sign the application using App Store Distribution profile.
But I have an application for which even if I create an IPA with the App Store distribution profile, I can install it on my test device (no it is not jail broken and yes it has the AdHoc Profile installed on the device). This particular profile was created during iOS 6.
Now when I create a new App Store distribution profile and I try to install on the test device with the AdHoc profile being present I am unable to do so.
Any idea as to how is it possible? Technically as per my understand App Store Distribution profile signed IPA should never be possible to be installed on devices directly using iTunes. It has to be installed through App Store (after Apple's approval).
It is not possible to do so. Somehow the old certificate allowed me to install the app in one of the device, after renewing the certificate it no longer allows me to install the app signed with the appstore certificate in the device.
So the final answer is that, it is not possible. It can only be installed on jailbroken devices (which is a different question altogether).

iOS Enterprise program: not able to install IPA file created using in-house provisioning profile on one of our device

We are using iOS enterprise account for distributing our iOS app. We are using the in-house distribution scheme of enterprise program.
As far as my knowledge, we don't need to install the in-house provisioning profile in the targeted device. Also, I believe that we don't need to add the device UDID in iOS portal since it's an enterprise account. Please correct my last two statements if my knowledge is wrong.
I am creating the IPA file using the in-house provisioning profile only. But while installing the same on one of our devices (iPhone 5s), I am getting below error.
"**A valid provisioning profile for this executable was not found.**"
I tried to install the same IPA file on another device (iPhone 4s). I have not installed the distribution provisioning profile in that device also. And it's working fine there. So only I concluded that We don't need to install any provisioning profile on the device in case of iOS enterprise program.
Below is my provisioning profile from enterprise account which I am using.
I am not sure why this is happening. Please help me and let me know if I am missing something.
You have to use a provisioning profile that is set for distribution. This profile needs to be using a certificate that is installed on the Mac you want to create the archive from. The profile gets installed along with the application.
You do not have to have the device added to the portal (only development devices need to be added).
One note - the profile will expire yearly. You will have to publish at least one update every year to include an updated and renewed provisioning profile.
Here's some screenshots:
Keychain Access:
Build Settings (Xcode):
Archive:

App store provisioning profile

I created one distribution profile for app store submission. Can i test my application in device with the same profile.
Or otherwise i need to create some other profile with ad hoc distribution?
You can not use an app store provisioning profile to test on a device. You can use an ad hoc profile, or a development profile.
Both ad hoc and development profiles require you to specify your device id.
The difference between an ad hoc and a development profile, is that a development profile can be used to debug. That is, you can use Xcode to build and install the app right on your device, and then step through code as the app is running to see values variables hold etc.
An ad hoc profile allows you to build an .IPA file and share that with beta testers (assuming of course you included their device id in the profile, or you have an Enterprise account/profile). They can install the .IPA file via iTunes (so they don't have to be a developer, or on Mac for that matter).
Yes, you have need to create ad hoc distribution profile for test. You cann't test with distribution profile(app store submission). read this About Store Provisioning Profiles and Creating Store Provisioning Profiles
Sorry!! you can't.
App Store > create a distribution provisioning profile to submit to the App Store
Ad Hoc > create a distribution provisioning profile to install a limited number of registered devices.
So you need to create a new Ad Hoc type distribution profile to install your device.
The answer to your question is 'NO'. You can not use 'store distribution provisioning profile' for testing your app on a device. It is intended to be used only for submitting your app to App Store.
To test your app before you submit it to App Store, you need to create separate 'ad-hoc distribution provisioning profile'. This will help you to beta test your app before submission as refered here..
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW1

Resources