Skip to content

Instantly share code, notes, and snippets.

@neilco
Created June 13, 2014 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilco/a4ca2a314b392b7cd4ec to your computer and use it in GitHub Desktop.
Save neilco/a4ca2a314b392b7cd4ec to your computer and use it in GitHub Desktop.
HOW-TO: Detect ad-hoc release builds at runtime
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT BOOL NCIsAdHocReleaseBuild();
#import "NCAdHocUtils.h"
#ifdef DEBUG
static BOOL NCDebugBuild = YES;
#else
static BOOL NCDebugBuild = NO;
#endif
BOOL NCIsAdHocReleaseBuild() {
return !NCDebugBuild && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"];
};
@neilco
Copy link
Author

neilco commented Jun 13, 2014

Add #import "NCAdHocUtils.h" to your .pch and you can call NCIsAdHocReleaseBuild from anywhere in your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment