4

At the command line, xcodebuild gives different results than building from within the Xcode UI.

Here is the command line that I pass:

$ xcodebuild -sdk iphonesimulator5.0 -configuration Release -scheme mylib -target mylib

It may be important to note that the target is set to create a static library file.

I know that different settings are being used because I have -Wundeclared-selector toggled off in the project file. However, I get these warnings when running xcodebuild from the command line.

It seems that others are also having this problem: Why does xcodebuild give different build results than XCode UI

1 Answer 1

5

I had multiple versions of Xcode installed on my machine. This fixed it:

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Parveen, I'd been tearing my hair out over this. You could mark your own answer as the correct answer.
I was using two different version of Xcode, and building using xcodebuild was failing while Xcode built successfully. This saved wasting my hours.

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.