如何确定我拥有哪个 iOS SDK?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1480184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 16:27:36  来源:igfitidea点击:

How do I determine which iOS SDK I have?

iosxcodexcodebuild

提问by Josh Brown

I'm sure this is simple, but how do I determine which version of the iOS SDK I currently have installed?

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

回答by Johan Kool

If you type this:

如果你输入这个:

$> xcodebuild -showsdks

it gives something like this:

它给出了这样的东西:

$> 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

回答by Jason Medeiros

If you care about the build number (like "10B61"), especially during betas, the best place to check which version of Xcode and related SDKs you have installed is to use "System Information".

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

Apple Menu > About This Mac > System Report > Software > Developer

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

Once there, you'll see version and build numbers for all of the major components of the Developer Tools. The top level version and build number corresponds to the name of the disk image you downloaded from Apple.

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

This is as of macOS 10.14.3.

这是从 macOS 10.14.3 开始的。

回答by Nitin

For latest version of MAC OS Mountain lion:

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

Apple Menu > About this Mac > More Info... > System Report... > Software > Developer

Apple Menu > About this Mac > More Info... > System Report... > Software > Developer

You will find Developer information like this:

您会找到这样的开发者信息:

Version: 4.6 (4H127) Location: /Applications/Xcode.app Applications: Xcode: 4.6 (2066) Instruments: 4.6 (46000) SDKs: OS X: 10.7: (11E52) 10.8: (12C37) iOS: 6.1: (10B141) iOS Simulator: 6.1: (10B141)

版本: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)

回答by Josh Brown

Update:Thanks to Stan for showing how to do it with Xcode 4.3 on Lion:

更新:感谢 Stan 展示了如何在 Lion 上使用 Xcode 4.3:

ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/??SDKs/


The following command shows a listing of all the iPhone SDKs installed on your computer.

以下命令显示了您计算机上安装的所有 iPhone SDK 的列表。

ls /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

回答by Souf ROCHDI

The simplest why I found is to run this command line:

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

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

OR, if you have multiple XCodeversions:

或者,如果您有多个XCode版本:

sudo xcode-select -switch /Applications/Xcode<version_number>.app/Contents/Developer

fastlaneisn't able to successfully execute that command so it sounds like that you don't have an Xcode version selected for xcodebuildto run things with. Running the xcode-selectcommand above should do the trick for you ;)

fastlane无法成功执行该命令,因此听起来您没有选择用于xcodebuild运行的 Xcode 版本。运行xcode-select上面的命令应该可以为您解决问题;)

Source: https://github.com/fastlane/fastlane/issues/12784

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