I have been looking for this for a while, and there seems to be no direct way to get the full absolute path to a specific SDK. However, if you set the -sdk
and -find-library
switches for an arbitrary library and separate the last few parts of the path, you can get the full sdk path as follows:
[ 13:02 jon@MacBookPro ~ ]$ export SYS_ROOT=`xcodebuild -sdk iphoneos6.0 -find-library system` [ 13:02 jon@MacBookPro ~ ]$ echo "${SYS_ROOT/\/usr\/lib\/libsystem.dylib/}" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk [ 13:02 jon@MacBookPro ~ ]$ export SYS_ROOT=`xcodebuild -sdk iphonesimulator6.0 -find-library system` [ 13:02 jon@MacBookPro ~ ]$ echo "${SYS_ROOT/\/usr\/lib\/libsystem.dylib/}" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk
chown source share