116

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

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Josh Brown
  • 52,385
  • 10
  • 54
  • 80

7 Answers7

202

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
Johan Kool
  • 15,637
  • 8
  • 64
  • 81
62

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".

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

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.

This is as of macOS 10.14.3.

Jason Medeiros
  • 5,358
  • 3
  • 25
  • 18
19

For latest version of MAC OS Mountain lion:

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)

Nitin
  • 269
  • 3
  • 11
  • How is this different than Jason's answer combined with Stan's comment below it, which contained the information you've given long before your answer? – Arda Mar 24 '19 at 14:00
15

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

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.

ls /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Josh Brown
  • 52,385
  • 10
  • 54
  • 80
  • 4
    I think this changed due to how Xcode is now installed from the app store. I'm on 10.7 / Lion and had to do: **ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/** – Stan Kurdziel May 18 '12 at 19:57
1

from the desktop: utilities/system information/software/developer -- lists the installed SDK's

Mark
  • 11
  • 2
0

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:

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. Running the xcode-select command above should do the trick for you ;)

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

Soufiane ROCHDI
  • 1,543
  • 17
  • 24
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

Yoni
  • 26
  • 3