107

我确定这很简单,但是如何确定我当前安装的 iOS SDK 版本?

4

7 回答 7

182

如果您键入:

$> 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
于 2013-10-15T09:32:37.763 回答
58

如果您关心内部版本号(例如“10B61”),尤其是在测试期间,检查您安装的 Xcode 和相关 SDK 版本的最佳位置是使用“系统信息”。

Apple 菜单 > 关于本机 > 系统报告 > 软件 > 开发人员

在那里,您将看到开发人员工具的所有主要组件的版本号和内部版本号。顶级版本和内部版本号对应于您从 Apple 下载的磁盘映像的名称。

这是从 macOS 10.14.3 开始的。

于 2009-10-26T16:32:24.777 回答
19

对于最新版本的 MAC OS Mountain lion:

Apple 菜单 > 关于本机 > 更多信息... > 系统报告... > 软件 > 开发人员

你会发现这样的开发者信息:

版本:4.6 (4H127) 位置:/Applications/Xcode.app 应用程序:Xcode:4.6 (2066) 仪器:4.6 (46000) SDK:OS X:10.7:(11E52) 10.8:(12C37) iOS:6.1:(10B141) iOS模拟器:6.1:(10B141)

于 2013-06-18T12:19:09.570 回答
14

更新:感谢 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/
于 2009-09-26T19:28:18.210 回答
1

从桌面:实用程序/系统信息/软件/开发人员 - 列出已安装的 SDK

于 2021-09-30T09:56:55.147 回答
0

我发现最简单的原因是运行这个命令行:

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上面的命令应该可以为您解决问题;)

来源:https ://github.com/fastlane/fastlane/issues/12784

于 2019-12-23T21:46:59.857 回答
0
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

于 2021-11-05T10:37:04.567 回答