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 2016-04-27 14:21:06.359 xcodebuild[88326:4628314] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7f8012844eb0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk'>': SDK with name 'iphoneos8.1' being superceded by SDK with 'iphoneos8.1'. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk mac$ xcodebuild -showsdks 2016-04-27 14:24:26.543 xcodebuild[88334:4629525] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7f8cd15e4f50:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk'>': SDK with name 'iphoneos8.1' being superceded by SDK with 'iphoneos8.1'. OS X SDKs: OS X 10.9 -sdk macosx10.9 OS X 10.10 -sdk macosx10.10 iOS SDKs: iOS 8.1 -sdk iphoneos8.1 iOS Simulator SDKs: Simulator - iOS 8.1 -sdk iphonesimulator8.1
参考 http://www.ithao123.cn/content-10811313.html 特此感谢
目前编译libvlc的MAX机其他软件环境如下
mac$ sw_vers ProductName: Mac OS X ProductVersion: 10.10.5 BuildVersion: 14F27 mac$ uname -a Darwin xxx.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64