views:

29

answers:

2

I have a custom application which requires a bunch of things to be set up before it is run. I want to add it as a build phase so I can use it when I do "Build and Run" but not when I do "Build". How do I check it in a shell script which is run as a build phase at the end?

Please don't ask why

A: 

I don't even have a Mac, so this is purely my imagination. I assume, XCode allows you to specify which executable to run when "Build and Run" is used. If so, you can write a simple batch file, which will perform all the required setup and then run your main app. Point XCode to that file and you're fine.

Anton Gogolev
A: 

Don't know if there is something special triggered for "Build" vs "Build and Run". You might want to check out a different build configuration. Projects come with a Debug and a Build configuration, maybe add a "Config&Build" that has some flags set. If the flag is set then do your setup stuff. Then it would be easy enough to switch configurations. I do something similar with my debug output and only turning them on in the debug configuration.

ACBurk
that doesn't help, but i had to accept an answer :)
Nick Brooks