今天发现 Xcode 插件失效了,在「系统偏好设置 - 拓展」里,Xcode Source Editor 也不见了。最后在 这里 找到了解决方法。

The article Xcode​Kit and Xcode Source Editor Extensions by Zoë Smith, March 25th, 2019, says:

Finally, when multiple copies of Xcode are on the same machine, extensions can stop working completely. In this case, Apple Developer Relations suggests re-registering your main copy of Xcode with Launch Services (it’s easiest to temporarily add lsregister’s location to PATH first):

1
2
$ PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
$ lsregister -f /Applications/Xcode.app

因为之前我有多个版本的 Xcode,Xcode_10.3.appXcode_11.3.1.appXcode_11.4.app 等,从 App Store 下载最新版 Xcode (11.4.1) 后,删掉了旧的 Xcode,就出现了这个问题,在终端执行以上命令后就好了。

参考