Xcrun referencing old deleted iOS sdk and can't be updated

Updated to the new MacOS and thus got pulled along with new Command Line Tools. After that happened my CLTs couldn't run anything, tried resetting them, updating the path in Xcode (which there was only one option). Not matter what it boils down to xcrun is persistent on a iOS version that is no longer on my machine:

xcrun find simctl   
2022-10-03 16:52:08.950 xcodebuild[879:7392] Writing error result bundle to /var/folders/bs/cqd3mlfd3f95809vkksbdcbr0000gn/T/ResultBundle_2022-03-10_16-52-0008.xcresult
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk" cannot be located.
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk' (errno=No such file or directory)
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -find find 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "find", not a developer tool or in PATH

Similar errors get thrown for anything regarding xcrun. I have deleted XCode, deleted the CLTs and reinstalled both and I'm getting the same error. Any ideas on how to solve this?

Replies

For reference the SDK path from xcrun is what is stuck on the previous iOS version and won't update. Similar to this but none of the projects are linked to it and nothing in xcode is resetting it.

This feels dumb but what happened was it was referencing an old SDK path stored in the environment variables from my previous bash environment before I switched the zsh. deleted it, problem solved.

  • Ouch! Thanks for letting us know.

Add a Comment