I am using Xcode to build an old code and specify SDKROOT=/Developer/SDKs/MacOSX\"${HOST_VERSION}\".sdk/
I want to specify SDKROOT for latest SDK that comes
With xcodebuild -version -sdk macosx10.7 Path
you can get the Path to the OS X 10.7 SDK.
You may replace 10.7 by ${SDK_VERSION}
or ${HOST_VERSION}
depending on your needs.
I know of no command to obtain the version of OS X, which could be used to obtain the Path to the SDK matching the version of OS X currently running.
Note: for xcodebuild
to work, the user must have configured xcode-select
properly, for example xcode-select -switch /Application/Xcode.app
.