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.
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.