Xcodebuild command with absolute SDK path

I am using the xcodebuild command line tool to build an iOS application.

After installing Xcode45-DP1, it automatically uses the 6.0 SDK from the new Xcode45-DP1 application suite to create applications. There are 2 problems sending this application to the AppStore.

  • Now the application is automatically created with the latest SDK (6.0), but is still supported, so the application cannot be sent. SOLUTION: I copied the old SDK (5.1) to Xcode45-DP.app and the -sdk iphoneos5.1 is indicated on the command line

  • The second problem is that when ApplicationLoader checks the application, it sees that the SDK is being used from an unsupported version of Xcode (45-DP1) and rejects to download the application. SOLUTION: I would like to specify the absolute path for the SDK, for example: xcodebuild -sdk /path/to/5.1sdk...

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

Does anyone have any experience using the absolute path to sdk and in which file / directory should it indicate?

Thanks in advance.

+6
source share
1 answer

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 
+4
source

Source: https://habr.com/ru/post/918641/


All Articles