我确定这很简单,但我如何确定当前安装的iOS SDK版本?
$> xcodebuild -showsdks
它会得到像这样的东西:
$> OS X SDKs:
OS X 10.8 -sdk macosx10.8
OS X 10.9 -sdk macosx10.9
iOS SDKs:
iOS 6.1 -sdk iphoneos6.1
iOS 7.0 -sdk iphoneos7.0
iOS Simulator SDKs:
Simulator - iOS 6.0 -sdk iphonesimulator6.0
Simulator - iOS 6.1 -sdk iphonesimulator6.1
Simulator - iOS 7.0 -sdk iphonesimulator7.0
对于最新版本的MAC OS Mountain Lion:
苹果菜单>关于本机>更多信息...>系统报告...>软件>开发人员
您将会找到如下开发人员信息:
版本:4.6(4H127) 位置:/Applications/Xcode.app 应用程序: Xcode: 4.6 (2066) Instruments: 4.6 (46000) SDKs: OS X: 10.7: (11E52) 10.8: (12C37) iOS: 6.1: (10B141) iOS模拟器: 6.1: (10B141)
更新:感谢Stan演示了如何在Lion上使用Xcode 4.3完成此操作:
ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
以下命令列出了您计算机上安装的所有iPhone SDK的清单。ls /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
从桌面进入:实用工具/系统信息/软件/开发者 -- 列出已安装的SDK
我发现最简单的方法是运行这个命令行:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
或者,如果你有多个XCode版本:
sudo xcode-select -switch /Applications/Xcode<version_number>.app/Contents/Developer
fastlane 无法成功执行该命令,因此看起来您没有选择要使用 xcodebuild
运行的 Xcode 版本。运行上面的 xcode-select
命令应该可以解决问题;)
xcode-select --print-path #print your current path Probably this path
/Library/Developer/CommandLineTools
sudo xcode-select --reset #reset to the default command line tools path
xcode-select --print-path# the default should this path
/Applications/Xcode.app/Contents/Developer
xcrun -sdk iphonesimulator --show-sdk-path #the path: /usr/bin/xcrun
#should to print the num of iPhoneSimulator:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator{num}.sdk
-sdk iphoneos
还是-sdk iphoneos7.0
? - nn0p