我按照文档安装了VS Code并运行Shell Command: Install 'code' command in PATH
(和this answer中一样)
起初它正在工作,但重启后(我想)我无法从终端启动代码(这非常有用)。
这是我得到的错误:
LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier com.microsoft.VSCodeInsiders.
不确定是否有用:如果我输入which code
,我会得到/usr/local/bin/code
。
一种可能的解决方案是执行以下操作:
mdls -name kMDItemCFBundleIdentifier -r <app-path>
由此返回的包名称将是包的实际名称(com.microsoft.VSCodeInsiders
不是。)
然后,您可以通过键入open -b <bundle-name>
以及之后的任何args来打开应用程序。
提示:
- 你的<app-path>
可能包含空格,在这种情况下你应该用“(引号)”包围它。 - <app-path>
是以.app
结尾的目录的路径 - 你在应用程序的finder中看到的“icon”的路径在终端中,文件夹的名称将以.app
结尾。