iOS App Build Setting Differences between Debug and Distribution
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 Preproce开发者_C百科ssor Macros.
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.
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.
精彩评论