Xcode命令行工具

报错信息

macOS的版本是12.3.1,Xcode的版本是13.3.1,在终端里输入git status,然后有下面一段提示:

2022-05-06 17:20:43.213 xcodebuild[77022:1041489] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-05-06 17:20:43.214 xcodebuild[77022:1041489] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
On branch master
Your branch is up to date with 'origin/master'.

虽然git status也可以用,但这段提示令人不爽。

解决办法

我在终端里输入xcode-select --install之后,弹出一个安装的窗口,在安装完之后,再输入git status就没有上面哪些提示信息了。

总结

  1. xcode-select这个命令就是说如果你的电脑上安装了多个xcode的版本,可以通过这个命令来选择使用哪一个版本。

  2. 在 Xcode 中查看使用的 CommandLineTools

    Xcode –> Preferences –> Locations –> Command Line Tools

  3. 安装 CommandLineTools

    xcode-select --install