Running a Script While Building a Product

    Steps
  1. In the project editor, select the target to which you want to add a Run Script build phase.

  2. Click Build Phases at the top of the project editor.

  3. From the Add Build Phase menu in the lower-right corner, choose Add Run Script.

  4. Configure the script in the new Run Script pane that appears.

image: ../Art/RunningaScriptWhileBuildingaProduct.png

Execute commands for a build task 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.

You can use any of the shell languages available in your system.

To change the title of the run script, click the title and edit the label.

The screenshot shows a Run Script build phase that prints the name of the target being built in the log navigator.