I want to use different API's when running adhoc deployments of my app compared to appstore deployments. Can this be found out at runtime? I know I can use #if TARGET_IPHONE_SIMULATOR and #if DEBUG when running from xcode but I want adhoc deployments to be detected as well. Any ideas?
Asked
Active
Viewed 876 times
2 Answers
3
Check that "../iTunesMetadata.plist" exists in your NSDocumentDirectory.
This file is present in app store builds only - and it's in the root of your application so it's safe for app store submission.

Maria Zverina
- 10,863
- 3
- 44
- 61
-
It appears to be present for ad-hoc builds as well. I'm using TestFlight; perhaps TestFlight adds the metadata in order to get pretty icons while downloading the app. – Nick Farina Nov 24 '12 at 14:56
1
Add a Preprocessor Macro for your AdHoc configuration in Build Settings. #if ADHOC // do something

0x8badf00d
- 6,391
- 3
- 35
- 68
-
1That will work but it fails the requirement of doing it at runtime :) – Maria Zverina May 22 '12 at 11:28
-
@Brett I don't know if one can programmatically find if app has been signed with AdHoc or Debug certificate. This may work - If you can read embedded.mobileprovision in your App bundle and look for your Provisioning profile name. – 0x8badf00d May 22 '12 at 13:12
-
This is the right answer. Just change a variable if ADHOC defined and detect the variable value at runtime. – EPage_Ed Aug 22 '13 at 00:34