6

I'm just installed xcode command line tools using command xcode-select --install. Now every time I restart my computer and write to the terminal swift --version, I get the following warning.

I tried changing the xcode-select package using the xcode-select --switch ~ / Applications / Xcode.app command. It did not help. Even tried reinstalling Xcode Command Line Tools. It didn't help either. Always the same warning.

Can you please tell me what to do to avoid getting a Warning?

Computer: Apple MacBook Pro 13" M1 (2020)

OS: Big Sur 11.1

Screenshot

1 Answers1

4

try a simple, documented step first

The solution may be as simple as sudo xcode-select -r

This command resolved the issue for me on an M1 machine, and avoided the risk of experimenting with random, undocumented ideas from strangers. Seems worth trying first.

documentation

% xcode-select -h
Usage: xcode-select [options]

Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example, 
xcodebuild) as well as the BSD development commands (such as cc and make).

Options:
  -h, --help                  print this help message and exit
[...]
  -r, --reset                 reset to the default command line tools path
Kay V
  • 3,738
  • 2
  • 20
  • 20