Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

pod install or a React Native iOS build says the iphoneos SDK cannot be located

Errorxcrun: error: SDK "iphoneos" cannot be located

Short answer

The iphoneos SDK ships inside Xcode, not in the small Command Line Tools package. If xcode-select points at /Library/Developer/CommandLineTools, or a DEVELOPER_DIR variable points there, xcrun finds no iOS SDK. Print the active path with xcode-select -p and switch it to your Xcode.app.

  • Applies to Xcode 26, macOS 26, React Native CLI template, CocoaPods 1.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the folder xcode-select is using, and any DEVELOPER_DIR override in the current shell. The two answers decide which cause below applies.

    xcode-select -p
    echo "DEVELOPER_DIR=$DEVELOPER_DIR"
  2. 2Match what you see, then jump to its fix

    1. 1xcode-select -p prints /Library/Developer/CommandLineToolsxcode-select points at the Command Line Tools instead of XcodeFix
    2. 2xcode-select -p shows Xcode, but the error still appears in some terminals or in CIA DEVELOPER_DIR variable overrides the selectionFix

What does the error look like?

  • xcrun: error: SDK "iphoneos" cannot be located

Cause 1 of 2

xcode-select points at the Command Line Tools instead of Xcode

1Check

Apple describes the Command Line Tools package as a small separate download that holds the macOS SDK and tools such as Clang. It is not a full Xcode, so there is no iOS SDK in it. Check that a full Xcode is installed and which folder is selected.

xcode-select -p
ls -d /Applications/Xcode*.app

2Fix

Switch the active developer folder to your Xcode. The command needs an administrator password and applies to every user of the Mac. The same switch is available in Xcode under Settings, Locations, Command Line Tools.

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

3Verify

The printed path now ends in Xcode.app/Contents/Developer. Run the failing step again, for example pod install in the ios folder.

xcode-select -p
cd ios && pod install

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 2

A DEVELOPER_DIR variable overrides the selection

1Check

The xcode-select man page says DEVELOPER_DIR overrides the system-wide active developer directory. A line in ~/.zshrc, a CI job setting or an old shell can keep pointing it at the Command Line Tools.

echo "$DEVELOPER_DIR"
grep -n DEVELOPER_DIR ~/.zshrc ~/.zprofile ~/.zshenv 2>/dev/null

2Fix

Remove the variable, or point it at the Xcode developer folder. DEVELOPER_DIR accepts either the Developer folder or the Xcode.app folder.

unset DEVELOPER_DIR
# or, for this terminal only:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

3Verify

Open a new terminal tab, print the variable and run the step that failed.

echo "DEVELOPER_DIR=$DEVELOPER_DIR"
cd ios && pod install

Confirmed by keith.github.io

Did this fix it?

How do I stop it coming back?

  • After installing or renaming Xcode, run xcode-select -p once and make sure it ends in Xcode.app/Contents/Developer.
  • Install the Command Line Tools through Xcode settings and keep Xcode as the selected folder.
  • Do not export DEVELOPER_DIR in shell profiles; set it per job in CI instead.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

git, clang or xcrun stops working because the active developer folder is gone

xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun

The folder that xcode-select points to no longer holds developer tools, so xcrun, git, clang and make cannot start.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.