Archived
This project has been archived and is no longer supported by The Blindsight Corporation/Amazon.
BSMobileProvision
A category for parsing your iOS app's embedded.mobileprovision at runtime. Use it to, among other things, determine at runtime whether your app is being distributed as dev, release, ad hoc, app store, or enterprise.
Usage
#import "UIApplication+BSMobileProvision.h"
NSString *releaseModeString = @"UNKNOWN";
UIApplicationReleaseMode releaseMode = [[UIApplication sharedApplication] releaseMode];
switch (releaseMode) {
case UIApplicationReleaseAdHoc: releaseModeString = @"AdHoc"; break;
case UIApplicationReleaseDev: releaseModeString = @"Dev"; break;
case UIApplicationReleaseAppStore: releaseModeString = @"AppStore"; break;
case UIApplicationReleaseEnterprise: releaseModeString = @"Enterprise"; break;
// case UIApplicationReleaseUnknown: releaseType = @"UNKNOWN"; break;
}
NSLog(@"LAUNCHED WITH RELEASE TYPE: %@",releaseModeString);
Notes
If you want something less hacky, you should go with something like:
- DTFoundation's DTASN1Parser
- TCMobileProvision (which uses DTASN1Parser)
- What is a provisioning profile?
This was made in part possible due to the following references:
- what to look for in the provisioning profile
- building a property list from data
- NSScanner tips
- the importance of not reading it as UTF8
- .mobileprovision Files Structure and Reading
Somewhat related, Jin Budelmann notes that even when an app (such as one released through the app store) does not have an embedded.mobileprovision, the application binary will still be signed, and that that could be another source of information: