iOS development
iOS SDK
software development kit
iOS version
coding tutorial

How do I determine which iOS SDK I have?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

If you are debugging an Xcode build, choosing a deployment target, or comparing project settings across machines, you need to know which iOS SDKs are installed locally. The most reliable answers come from Xcode command-line tools, because they show both the available SDK names and the active SDK versions that Xcode can build against.

Understand What You Are Looking For

There are two related version concepts in iOS development:

  • the iOS SDK version installed with Xcode
  • the app deployment target your project supports

They are not the same. You might build with a newer SDK while still targeting older iOS releases for runtime compatibility. When people ask which SDK they have, they usually mean the first one.

List Installed SDKs With xcodebuild

The simplest command is:

bash
xcodebuild -showsdks

Typical output looks like this:

text
1iOS SDKs:
2	iOS 18.2                       	-sdk iphoneos18.2
3
4iOS Simulator SDKs:
5	Simulator - iOS 18.2          	-sdk iphonesimulator18.2

This tells you which device and simulator SDKs the selected Xcode installation currently exposes.

Ask For The Active iPhone OS SDK Version

If you want just the version number for the active device SDK, use xcrun.

bash
xcrun --sdk iphoneos --show-sdk-version

You can also inspect the SDK path itself:

bash
xcrun --sdk iphoneos --show-sdk-path

That is useful when a build script needs the physical SDK directory, not just the version string.

Confirm Which Xcode Is Selected

On systems with multiple Xcode installations, the selected developer directory determines which SDKs the CLI reports.

bash
xcode-select -p

If that path does not point to the Xcode you expect, the SDK output will also be misleading. To inspect the Xcode app version directly:

bash
xcodebuild -version

That command tells you the Xcode version and the build number, which is often the first thing to compare across machines.

Check Inside Xcode

You can also inspect the SDK from the IDE. Open a project, select the target, and look at the Base SDK and deployment settings in the build configuration. That is useful when you care about what the project is actually configured to use, not just what is installed globally.

The CLI is still better for scripting and for headless debugging on CI agents.

Distinguish SDK From Simulator Runtime

Simulator runtimes are related, but they are not the same as the base device SDK. You may have a given iOS SDK available for building while having fewer simulator runtime versions installed. If your build succeeds but a simulator choice is missing, that difference is often the reason.

In day-to-day work, use:

  • 'xcodebuild -showsdks for installed SDK inventory'
  • 'xcrun --sdk iphoneos --show-sdk-version for the active device SDK version'
  • Xcode project settings for the build configuration actually chosen by the app target

Example: Use The Value In A Script

A shell script can read the active SDK and print it in logs.

bash
1SDK_VERSION=$(xcrun --sdk iphoneos --show-sdk-version)
2XCODE_VERSION=$(xcodebuild -version | head -n 1)
3
4echo "Xcode: $XCODE_VERSION"
5echo "Active iPhoneOS SDK: $SDK_VERSION"

This is useful in CI pipelines where environment drift causes builds to behave differently from local machines.

Common Pitfalls

The most common mistake is confusing the deployment target with the installed SDK version. The deployment target tells you the minimum runtime version supported by the app, not which SDK Xcode is compiling against.

Another mistake is forgetting that xcode-select controls the active developer directory. If multiple Xcode versions are installed, the command-line tools may be reporting SDKs from a different Xcode than the one you opened in the GUI.

A third issue is assuming a simulator runtime implies the same device SDK or vice versa. They are distributed together often enough to feel related, but they are still separate pieces of the toolchain.

Summary

  • Use xcodebuild -showsdks to list the SDKs installed for the active Xcode.
  • Use xcrun --sdk iphoneos --show-sdk-version to print the active device SDK version.
  • Check xcode-select -p if you have more than one Xcode installed.
  • Do not confuse the installed SDK with the project deployment target.
  • Use both CLI tools and project settings when debugging build environment mismatches.

Course illustration
Course illustration

All Rights Reserved.