SDK "iphoneos" cannot be located

在MAC下,交叉编译libvlc出现的一些问题和解决方法。
项目中使用了libvlc开源库。
在执行编译脚本中,遇到一句xcrun --sdk iphoneos --show-sdk-path报错

mac$ xcrun --sdk iphoneos --show-sdk-path
xcrun: error: SDK "iphoneos" cannot be located

查找原因:

mac$ xcode-select --print-path
/Library/Developer/CommandLineTools

发现是这个Xcode路径判断错误。

mac$ xcodebuild -showsdks
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

回想起最近安装了另外两个版本的Xcode,应该是这样导致了路径错误。

mac$ ls /Applications/Xcode
Xcode.app/ Xcode2.app/ Xcode3.app/

解决方法:给Xcode命令行工具指定路径

mac$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/

再回头查看

mac$ xcrun --sdk iphoneos --show-sdk-path
-- ::06.359 xcodebuild[:] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7f8012844eb0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8..sdk'>': SDK with name 'iphoneos8.1' being superceded by SDK with 'iphoneos8.1'.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8..sdk
mac$ xcodebuild -showsdks
-- ::26.543 xcodebuild[:] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7f8cd15e4f50:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8..sdk'>': SDK with name 'iphoneos8.1' being superceded by SDK with 'iphoneos8.1'.
OS X SDKs:
OS X 10.9 -sdk macosx10.
OS X 10.10 -sdk macosx10. iOS SDKs:
iOS 8.1 -sdk iphoneos8. iOS Simulator SDKs:
Simulator - iOS 8.1 -sdk iphonesimulator8.

参考 http://www.ithao123.cn/content-10811313.html 特此感谢
目前编译libvlc的MAX机其他软件环境如下

mac$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.
BuildVersion: 14F27
mac$ uname -a
Darwin xxx.local 14.5. Darwin Kernel Version 14.5.: Wed Jul :: PDT ; root:xnu-2782.40.~/RELEASE_X86_64 x86_64
上一篇:华为虚拟机结合VMware搭建环境测试snmp


下一篇:Linux Shell函数定义与调用