How to get Xcode 4 to run my pre-action?

I cannot get Xcode 4 to reliably perform my preliminary steps. I tried to clean and rebuild. He does not seem to do this consistently. Is this even an attempt? I can not tell. I added some echo (this is a bash script) and nothing happens. All this worked in Xcode 3.

+4
source share
3 answers

Remember that pre-actions do not capture env variables. They are primarily intended to download or notify that the assembly is starting. If it worked in Xcode 3, you can use it more as a build script than a preliminary action.

+1
source

Please note that your actions before assembly are not performed in the project source directory. They run somewhere in Library/Developer/XCode/DerivedData/ .

If you want to play with files in the project source directory before compilation, you need to add it using ${PROJECT_DIR}/ .

+16
source

You need to add β€œRun Script” to the build phases, and then drag it over the build phase of the compilation sources.

I still do not understand the purpose of the "pre-action", it seems, is not even fulfilled. However, in my case, I just needed a script to execute before my sources were compiled.

+5
source

All Articles