Can't find Xcode install for Metal compiler

I solved this in the following way…

  1. Open Xcode
  2. Go to Xcode preferences (CMD+,)
  3. Find the Location tab
  4. In the last drop down (Command line tools), select the appropriate Xcode version. In my case no version was selected and that was casuing the issue.

Note: The terminal method shown in other answers does the same thing.

5 Likes