-1

I need to install the command line developer tools for Xcode 12.2 on a fresh upgrade to macOS Catalina.

Whether I install command line developer tools by clicking Install when I get:

Swift requires the command line developer tools

after typing swift in a Terminal window, or I install by downloading Command_Line_Tools_for_Xcode_12.2.dmg from developer.apple.com

Download/install Command_Line_Tools_for_Xcode_12.2.dmg

I still get:

:~/ > swift
xcodebuild: error: SDK "macosx10.14" cannot be located.
swift: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx10.14 -find swift 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'swift', requesting installation of command line developer tools.

Suggestions?

Calaf
  • 10,113
  • 15
  • 57
  • 120
  • What happened on SO? Granted, the question lacks profundity. But weren't questions about tools quite ok over here? – Calaf Dec 01 '20 at 15:09

1 Answers1

1

It sounds like you didn't install the PKG that lives on the DMG that you downloaded. But if you did, it sounds like you need to add this step:

sudo xcode-select -s /Library/Developer/CommandLineTools
mr. fixit
  • 1,404
  • 11
  • 19
  • Great! That does it. Now before the `Welcome .. ` message and the prompt `1>`, I get `swift: error: SDK "macosx10.14" cannot be located`, `:0: warning: no such SDK: 'macosx10.14'`, but that's a good start. And indeed in `/Library/Developer/CommandLineTools/SDKs` I have `MacOSX.sdk -> MacOSX11.0.sdk`, `MacOSX10.15.sdk`, and `MacOSX11.0.sdk`, but no `MacOSX14.0.sdk`. Could it be that Xcode 12.2 is expecting me to be on Big Sur (10.15)? – Calaf Dec 01 '20 at 04:17
  • No. Xcode 12.2 doesn't require Big Sur. – mr. fixit Dec 01 '20 at 13:09
  • if my answer works for you, may i ask that you 'select' it? – mr. fixit Dec 01 '20 at 13:10
  • This last remaining problem is a tricky one, and it's been going on https://trac.macports.org/ticket/59837 since Mojave. Speculation: those who start from a clean macOS have no issues, but those who have multiple ancient SDKs inherited through Time Machine (or similar) in /Library/Developer/CommandLineTools/SDKs have this problem when we install an Xcode that's been developed for an OS version higher than the one we have just upgraded to. – Calaf Dec 01 '20 at 15:23