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.

bullet
To run a script while building a product
  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. Choose Editor > Add Build Phase > Add Run Script Build Phase.

  4. Disclose the Run Script section in the project editor.

  5. 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.

    ../Art/run_script_configuration_2x.png

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