Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild command with absolute path to SDK

I am using xcodebuild command line tool to build iOS app.

After instaling Xcode45-DP1 it is automatically using 6.0 SDK from the new Xcode45-DP1 app bundle for building applications. There are 2 issues when submitting this app to AppStore.

  1. The app is now automatically built with latest SDK (6.0), which is note yet supported, so app cannot be submitted. SOLUTION: I copied the old-current SDK (5.1) to Xcode45-DP.app and in command line specified -sdk iphoneos5.1

  2. Second problem is that when ApplicationLoader is verifying app, is sees that SDK is used from unsupported version of Xcode (45-DP1) and rejects to upload app. SOLUTION: I would like to specify absolute path for SDK, like: xcodebuild -sdk /path/to/5.1sdk...

The problem is that xcodebuild always says that SDK "/path/to/iPhoneOS5.1.sdk/" cannot be located.

Does anyone have an experience with how to use absolute path to sdk and what file/directory should it point to?

Thanks in advance.

like image 702
Miroslav Kovac Avatar asked Jun 21 '12 08:06

Miroslav Kovac


1 Answers

I have been searching for this for a while as well and there does not appear to be a direct way of getting the full absolute path to a specific SDK. However, if you set the -sdk switch and -find-library for an arbitrary library and strip the last few path parts off you can get the full sdk path like so:

[ 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
like image 66
chown Avatar answered Sep 27 '22 19:09

chown