Copying Files While Building a Product

Copy files and resources of any type to specific locations as part of the build process using a copy files build phase.

To copy files while building a project
  1. In the project editor, select a target.

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

  3. Choose Editor > Add Build Phase > Add Copy Files Build Phase.

  4. Disclose the Copy Files section in the Build Phases pane of the project editor.

  5. Use the Destination pop-up menu and the Subpath text field to specify where to copy the file or files.

  6. Click the Add button (+) to select a file to copy and click Add.

    The screenshot below shows a build phase that copies the Adventure_Info.plist file to a folder titled Info in the Resources folder.


Together, the Destination pop-up menu and the Subpath field specify the location to which Xcode copies the files. The Destination pop-up menu lets you choose from a number of standard locations. Use the Subpath field to specify the path, relative to the location specified in the Destination pop-up menu, to the target directory.

Select the option "Copy only when installing" to specify that the build phase copies files only in install builds of the product.