Reputation: 30558
I am using Xcode to develop application. But I include some test files, and I would like to keep a reference timestamp while I do compiling. Is this possible for me to do some scripting before I start compiling the programme? Of course, I can manually run the script before I compiling, but I would like to do it in one step
, and recommend? Thanks.
Upvotes: 7
Views: 6692
Reputation: 5625
Just to clarify a little, since the above answers did help me out eventually but were kind of confusing at first:
After you create a new Run Script in your Build Phases:
Use shell = /usr/bin/python
, if what you put in the script text box is pure python code.
Use shell = /bin/sh
if you want to run a python file, and include the full command to launch the script e.g.:
Upvotes: 6
Reputation: 307
Upvotes: 6
Reputation: 5187
You need to add a build phase. Go to the project file, Build Phases, click Editor on the tool bar menu, add Build Phase, Add Run Script... You can select and drag the script to put it before/after anything.
Then the shell should be /usr/bin/python, then you can type in your script below. The script will run every time you build.
Upvotes: 9