简体   繁体   English

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

[英]How do I determine which iOS SDK I have?

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

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

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 开始的。

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)

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/

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 XCode versions:或者,如果您有多个XCode版本:

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

fastlane isn't able to successfully execute that command so it sounds like that you don't have an Xcode version selected for xcodebuild to run things with. fastlane无法成功执行该命令,因此听起来您没有为xcodebuild选择 Xcode 版本来运行它。 Running the xcode-select command above should do the trick for you ;)运行上面的xcode-select命令应该可以为您解决问题;)

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

从桌面:实用程序/系统信息/软件/开发人员 -- 列出已安装的 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM