views:

74

answers:

1

Is there any way to determine in code whether the app currently running is a developer, ad-hoc, or app store build?

+1  A: 

You could add C preprocessor definitions for each type to your build configuration, and use that definition to set a variable or flag in executable code.

Debug builds can be sometimes be detected by calling a benchmark loop whose run time varies significantly between -O0 and -Os optimization levels on a known device model.

Apple is reported to change an app's Info.plist in App store distributions, so you could count and checksum the plist items.

hotpaw2
None of the above will work for a pre-compiled static lib without external input (or perhaps reading the Info.plist for additions/changes not officially documented by Apple).
hotpaw2