Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Xcode 4 run my Pre-Actions?

Tags:

xcode

xcode4

I can't seem to get Xcode 4 to reliably execute my pre-actions. I've tried cleaning and rebuilding. It doesn't seem to do it consistently. Is it even trying? I can't tell. I've put some echos in it (it's a bash script) and nothing is happening. This all worked in Xcode 3.

like image 779
101010 Avatar asked Nov 29 '22 18:11

101010


2 Answers

You need to add a "Run Script" to your build phases, and then drag it's position above the compile sources build phase.

I don't understand the purpose of a "pre-action" yet, doesn't seem to even get executed. However in my case I just needed a script to execute before my sources were compiled.

like image 20
Brad G Avatar answered Dec 09 '22 10:12

Brad G


Note that your pre-build actions are not executed in your project's source directory. They are executed somewhere in Library/Developer/XCode/DerivedData/.

If you want to play with files in your project's source directory before compilation, you need to prepend it with ${PROJECT_DIR}/.

like image 163
webmat Avatar answered Dec 09 '22 09:12

webmat