Monday, December 19, 2011

Multiple Build Targets, Same Name

Have you ever wanted to have multiple build targets like Angry Birds? They use the different icons and the same name, "Angry Birds," below each of them (mostly). The icons says stuff like, "Free."

Anyway, here we go... Xcode 4.x, an already-working target:
  1. Duplicate your target
  2. Now you will have a target with a funny new name and a new plist. So
  3. Rename the target
  4. Rename the plist
  5. Adjust the target settings in the Project  to point to the renamed plist. If you don't do this, Xcode will pretend it's fine, but it's not.
  6. Adjust target so that it's got a unique Product Name. If you use the same one more than once, you will rot in hell forever.
  7. Now go to the plist that your target  is pointing to and adjust its CFBundleIdentifier to be something unique.
  8. In that same plist, adjust your CFBundleDisplayName to be the display name you want, e.g., "Angry Birds"
  9. Xcode will also have created a new "Scheme" for this new target. You can rename the scheme and it will still point to the target, so all is good.
  10. Bring a bunch of Icon.png files in, and associate each one with the correct target.
Now I have to figure out if this is a good idea. However, don't do this just to get some different arguments in. For that, you can just use schemes, as I mention here:

Xcode, iOS, iPad, Objective-C, Multiple Build Targets

No comments: