2

I use following command to build project using xcodebuild from the directory where .xcodeproj is.

admin$ xcodebuild install DSTROOT=. INSTALL_PATH=/bin

Could someone please tell me how to specify full path of .xcodeproj in xcodebuild command and run it from anywhere?

[EDIT]

...so you cannot specify absolute path of the project with xcodebuild command but you can specify where do you want your .app file placed like following. You need to run this command from the root project directory and you will be able to compile other sub projects without CD to their directories but you need to specify "scheme" that you are building.

admin$ xcodebuild install DSTROOT=/Users/admin/myProjectRoot INSTALL_PATH=/bin -scheme MySubProject1 -configuration Release -sdk iphonesimulator clean build

1 Answer 1

3

According to the manpage for xcodebuild, you must launch "xcodebuild" from within the directory where your project is. I.E. the specific line that clarifies that is:

To build an Xcode project, run xcodebuild from the directory containing your project (i.e. the directory containing the projectname.xcodeproj package).

And if there are multiple projects within that directory, that's when you can use the "-project projectname" command line parameter.

In my own build scripts, I "cd" to the folder where the project lives before calling "xcodebuild".

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Michael! Now I am running this command from the root project's folder and able to provide "scheme" for various other projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.