Running a Script While Building a Product
Execute optional commands for a build task by using a run script build phase. For example, you can archive files using
tar, send mail, write messages to a log file, execute AppleScript scripts, and so on. Any number of run script build phases are allowed in a target.
In the project editor, select the target to which you want to add a run script build phase.
Click Build Phases at the top of the project editor.
Choose Editor > Add Build Phase > Add Run Script Build Phase.
Disclose the Run Script section in the project editor.
Configure the script in the Run Script template.
The screenshot shows a Run Script build phase that prints in the log navigator the name of the target being built.