最 近 在 使用 最 新 的 m1版本 的 mac book air, 从 App store安装好Xcode后, 在Terminal中运行运行Xcode build命令时会出现"Error tool xcodebuild requires Xcode, command line tool xxxx"这样的提示.

于是在百度尝试查找解决方法, 找了很多文章 ,都说使用需要使用xcode-select命令切换 xcode的环境以解决这个问题, 经过我在我的mac book air上测试, 其实这些文章说的这个方向无错 ,但切换的目标错了, 后来我在英文网站上找到了如下的回复 , 经我这台 mac book air测试后发现能解决问题, 希望能为出现了同样错误但根据百度上的文章却解决不了的问题的朋友提供另一个思路:

This fixed it for me:

Install Xcode from app store (or uninstall the original Xcode then install again)Run Xcode sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

查看原文