[英]How do I determine which iOS SDK I have?
我确定这很简单,但是如何确定我当前安装的 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
如果您关心内部版本号(如“10B61”),尤其是在测试版期间,检查您安装的 Xcode 和相关 SDK 版本的最佳位置是使用“系统信息”。
Apple 菜单 > 关于本机 > 系统报告 > 软件 > 开发人员
在那里,您将看到开发人员工具的所有主要组件的版本号和内部版本号。 顶级版本和内部版本号对应于您从 Apple 下载的磁盘映像的名称。
这是从 macOS 10.14.3 开始的。
对于最新版本的 MAC OS Mountain Lion:
Apple Menu > About this Mac > More Info... > System Report... > Software > Developer
您会找到这样的开发者信息:
版本: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/
我发现的最简单的原因是运行此命令行:
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
命令应该可以为您解决问题;)
从桌面:实用程序/系统信息/软件/开发人员 -- 列出已安装的 SDK
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.