4

For an iPhone/iPad app, what build settings do you make differently between the Debug and Distribution build? Please note any unique settings that you would do for iPhone only apps and iPad only apps.

Here is what I am doing currently (some already set by default by Xcode), but would like to gather an exhaustive list. The usual path stuff is not included in the list.

For adhoc and App Store distribution build:

  • Enable Validate Build Product
  • Set Optimization Level to fastest and smallest
  • Assign Entitlements.plist to Code Signing Entitlements
  • Strip Debug Symbols During Copy
  • Add NS_BLOCK_ASSERTIONS=1 to "Other C Flags"
  • For iPad only app, set Architectures and Valid Architectures to Optimized (arm7)

For debug build:

  • Add DEBUG to Preprocessor Macros.
Boon
  • 40,656
  • 60
  • 209
  • 315

2 Answers2

1

In a Debug build, I also usually set the preprocessor macro DEBUG and then use a macro like DLog instead of NSLog for all of my logging.

André Morujão
  • 6,963
  • 6
  • 31
  • 41
  • Yes should have included this in the list, will update. Thanks. – Boon Apr 11 '11 at 15:51
  • There are also a bunch of other differences between my debug and ad-hoc/distribution builds, although I control them mostly through preprocessor macros. Stuff like: ads (live vs test ads), tracking (e.g. tracking on Google Analytics vs writing the equivalent page views / events to the console), test environment settings (in case you're using remote services), etc. – André Morujão Apr 11 '11 at 15:55
1

Recently I discovered that LLVM 2.0 (sometimes?) produces buggy executables for 1st-generation iOS devices, but it's faster and nicer to develop with LLVM than GCC, so I set Debug builds to use LLVM and Release builds to use LLVM-GCC.

Also, I don't think manually setting Entitlements has been necessary for some time now. Xcode seems to automatically apply the correct entitlements for ad-hoc builds.

Community
  • 1
  • 1
Daniel Dickison
  • 21,832
  • 13
  • 69
  • 89
  • Good to know. Do you know if Xcode does the same for app store builds with the entitlements? – Boon Apr 11 '11 at 16:29
  • I haven't had to manually set entitlements for ad-hoc or app store builds for maybe the past year or so. So I think Xcode is handling all of this automatically now (at least if you use the Archive and Submit features). – Daniel Dickison Apr 12 '11 at 04:46