Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

PBXProject.AddFile

Switch to Manual
public function AddFile(path: string, projectPath: string): string;
public function AddFile(path: string, projectPath: string, sourceTree: iOS.Xcode.PBXSourceTree): string;

Parameters

pathThe physical path of the file.
projectPathThe project path of the file.
sourceTreeThe source tree the path is relative to. By default it's PBXSourceTree.Group.

Returns

string The GUID of the added file.

Description

Adds file to the project.

To add the file to the list of files to build, pass the returned value to AddFileToBuild.