Drico
Drico

Reputation: 1370

Access workspace path in XCode Build Phases script

In XCode, I'm building a Build Phases script in which I need to call xcodebuild with a workspace as parameter.

I know how to get a project's path (PROJECT_FILE_PATH), but I can't find a way to find the workspace's path.

For now I'm using a trick to change the extension of project's path from .xcproject to .xcworkspace :

WORKSPACE_FILE_PATH="${PROJECT_FILE_PATH%.*}.xcworkspace"

But I'd rather use a better solution.

Anyone got a clue ?

Upvotes: 1

Views: 1178

Answers (1)

SalmonKiller
SalmonKiller

Reputation: 2203

Usually, the workspace file is in the same directory as the project file, so you can just do it that way.

Upvotes: 2

Related Questions