views:

94

answers:

5

I like to keep a store-bought version of my iPhone apps on my phone so that I can reproduce any customer issues that come up, but I obviously also want to run the most current development version. I can install both (one from iTunes, one from xCode) but I'm interested in ways that I'm better able to tell the two apart. I could just change the name or icon temporarily, but that doesn't seem very failsafe, i.e. I might forget and ship it with the wrong icon.

Is there a happy funtime developer way to do this?

A: 

Most probably there is no other way. Your app store version and development version is completely different to the OS. If you want to distinguish, you need to change the icon or name. You can also include some debugging label (e.g. version number) in your development version, but you may also forget to remove this.

taskinoor
A: 

Maybe you'd just buy a second iPhone? Seriously. On your place I'd ask the same question as you do, but I will definitely take such a solution in mind. If I was an iPhone (or whatever other specific platform) developer, I'd most probably have more than one.

Ivan
+1  A: 

Here's an idea - if you set a User-Defined Setting in your Project Build properties for Debug only along the lines of USE_DEV_ICON=YES (or something). Then, using the "Run Script" option in your Build Target you could copy different icons based on which Active Configuration you called.

Something along the lines of (pseudo-code):

if ($USE_DEV_ICON == YES)
    cp DevIcon.png Icon.png
else
    cp RealIcon.png Icon.png

Then every time you build, depending on the active configuration, it will copy the correct icon.

Eric
+3  A: 

I was inspired by Eric's idea of adding a user-defined setting to the project but I didn't want to run a script every time I built the project.

We know that the iPhone looks for icon files named "Icon.png" by default. It turns out that the "Icon File" setting in the project plist isn't necessary at all if you've named your icon properly. However, if there is no file named "Icon.png" in the project, xCode looks at the value of the "Icon File" setting.

I set a user-defined setting in "Debug" called "Icon_Name" to a non-standard icon name, "DevIcon.png" and "ReleaseIcon.png" for the "Release" config. The "Icon File" setting in the project plist can now be set to ${ICON_NAME} and will take on the value of whatever config file we're using. Now building under two different configurations does use two different icons.

Edit: For multiple icons (high res, small, ipad, etc) I made a slightly different approach. The user-defined setting is now "IconPrepend" which is "Dev" for debug and "Release" for release config. I'm now using "Icon Files" (rather than "Icon File") in the info plist which takes an array of strings. Each string is prepended with ${ICONPREPEND} so that debug configurations look for "DevIcon.png" or "[email protected]" and release configurations look for "ReleaseIcon.png" or "[email protected]".

Nick
Nice! I think I will use this one myself. :)
Eric
A: 

Couldn't you make a new target which has a different Bundle name in the Info.plist file, and use this target whenever you want to build the app to run on your iPhone?

Tom W