Xcode supports this well. I used Chris Fletcher’s instructions:
- Start a new XCode Project
- Duplicate the current Target
- Rename the Duplicated Target
- Rename the Duplicated Info.plist File
- Change the Icons in the Duplicated Info.plist file to use the Lite Version Icons
- Change the Bundle Identifier to match with the bundle identifier from Apple for the Lite Version
- Edit Build Properties of the Duplicated Target
- Add C / C++ Compiler Flags
- Change the Product Name
- Change the name of the Info.plist file to the name of the Duplicated Info.plist File- Add Logic to code to separate features of Lite and Full version.
Chris’ explanation is good, but here are a few gotchas:
- Say you are going to have two versions of a Resources, eg. MyResourcesFolder-Full and MyResourcesFolder-Lite, you want first remove references to both of these folders before duplicating the target. Then you add MyResourcesFolder-Full to only the full target and MyResourcesFolder-Lite to only the lite target.
- You only have to change the BundleIdentifier field in the copied Info.plist to be anything you want. For instance, com.yourcompany.${PRODUCT_NAME:rfc1034identifier} can be renamed to anything: eg: com.joesfishhouseonbleecker.${PRODUCT_NAME:rfc1034identifier}. When he talks about “Apple assigning the identifier” this happens in Xcode, you don’t have to go to the provisioning portal etc.
- You have to add a row when you are editing the copied Info.plist before you can specify an icon file name for the lite version. I also explicitly named the icon in my full version to avoid any confusion
- Before building each target I needed to delete the build folder manually, or else some of the wrong resources got put in each version
- You might need to delete the iPhone simulator folder in ~/Library/Application Support/iPhone Simulator before building