Reputation: 1394
We are testing a scenario and iPad seems to take the new provisioning profile all the time even if we install app that is signed with old provisioning profile.
We have a provisioning profile that expires end of this month. So, we renewed it and it is due to be pushed by MDM. We wanted to test it before we do that, so we tried to replicate the scenario. We generated an iPa that is signed to old PP, pushed via MDM and downloaded it. Now, if we change the date of the iPad to future date, it should crash as PP is not valid. But, it still works.
We tried installing the app with new renewed PP via crashlytics and it worked as per our expectation. Now, we trying to test it via MDM and it works all fine even if you change it to future date.
Our suspicion is somewhere iPad stores the new PP of our app, and it supersedes the old PP which results in app working all the time.
My question here is, Can we check the PP of a particular App installed in iPad? Does it not get deleted from the iPad if we delete the app? Can we delete the PP manually from iPad? If so, how?
Any help is much appreciated.
Upvotes: 3
Views: 5414
Reputation:
You can see what PP's are installed for an app on an iOS device, and delete them as necessary, via "Windows/Device and Simulators"
Then right click on your device, and select "Show Provisioning Profiles..."
You can then add or delete as required from there.
Make sure to kill the app on the iOS device before launching (double click Home button and swipe up your app), otherwise it will just use the one in memory which will work as before your latest install.
Upvotes: 0
Reputation: 13619
To elaborate a bit on @battlemonstr's answer, the provisioning profile is bundled with the .ipa when you package (in an embedded.mobileprovision file) so that the iOS device can install the PP on the device when the app is installed. After installation from the .ipa, the embedded PP is irrelevant - it becomes just another PP installed on the device. When you first try to run the app, iOS will check if there is a valid PP on the device that would allow the app to run. It can be the one installed with the app, but there is no reason it has to be. In other words, the installed app does not have anything that requires it to use the PP that was bundled with it in the .ipa file.
When you delete the app, it does not touch the PPs installed on the device. So if you installed a version of the app previously, and it had an embedded PP that didn't expire until the end of the year, installing a new version of the app with a PP that is already expired will not prevent the app from running, since the device has a PP that is valid for the app that won't expire until the end of the year.
You can see the provisioning profile on the device in the Xcode devices window. Right-click on the device and select "Show Provisioning Profiles..." Note that iOS will try to clean up old provisioning profiles that have expired from time to time, so some old ones might be gone.
Upvotes: 5
Reputation: 6280
A provisioning profile is a file that confirms a permission from Apple to run app X from an app developer developer Y on a device Z. X can also be a set of apps, but for production case usually it is just a single app ID. Z can also be a set of devices, and for production it is usually the case.
Think of a PP as of a kind of a certificate signed by Apple that anyone can verify.
Can we check the PP of a particular App installed in iPad?
I think that a copy of a PP is located inside the app bundle, so if you can make a backup of the device and somehow extract it, you might find it there. (see also How to find out what profile was used for building *.ipa file? )
Does it not get deleted from the iPad if we delete the app?
Probably not, at least not always. They are installed into some special system's location.
Can we delete the PP manually from iPad?
The Settings app has a section "General > Profiles and Device management" which normally has a list of installed profiles (see https://apple.stackexchange.com/questions/221052/ios-9-2-my-general-profiles-and-device-management-is-gone ). I don't know the exact rules about it, but on my 2 devices this "Profiles and Device management" section is hidden. Some people also mention that if you connect a device to a Mac with Xcode, then in the "Devices" tool/pane you can also get a list of installed profiles (see https://forums.developer.apple.com/thread/45086 ).
From your description it seems that both your old app and your new app version are working, because the system has found a valid PP for both of them (inside the new app), and saved it.
Upvotes: 1