How do I use a relative path in Xcode project settings?

后端 未结 6 1944
慢半拍i
慢半拍i 2021-01-30 10:24

How do I use a relative path in Xcode project settings?

6条回答
  •  天涯浪人
    2021-01-30 10:53

    The various answers currently here which recommend setting the working directory when executing a project by editing the scheme and then choosing whatever directory you want are missing what seems like a key part of the question: Relative Path. If you just use the file navigator in the UI you'll get an absolute path, likely with your own home directory in it, which isn't so good if the project you're working on is shared with other people. To specify a working directory relative to the project folder in there, find the "Working Directory" field in the scheme (In XCode 10.1, that's Product | Scheme | Edit Scheme, then Options, then check "Use Custom Working Directory"), and use $PROJECT_DIR to get the path relative to the project.

提交回复
热议问题