Visual Studio 无法打开代码,因为 "Apple cannot check it for malicious software"

Visual Studio Code can't be opened because "Apple cannot check it for malicious software"

我第一次下载了 Visual Studio 代码,但我不断收到以下消息:

"Visual Studio Code" can't be opened because Apple cannot check it for malicious software.

This software needs to be updated. Contact the developer for more information.

我的 MacBook 是最新的,我什至在他们的网站上更新了最新版本的 VSC(2019 年 9 月(1.39 版);10 月有 none),但它仍然给我同样的信息.

查看他们的常见问题解答,我了解到有关重新安装 VS Code 的信息。我这样做了,但还是不行。

macOS Catalina 要求应用程序经过 Apple 公证。 Microsoft 尚未针对新 OS.

更新您的 Visual Studio 代码版本

请尝试以下操作:

Right-click on the app and select Open.

如果这不起作用,请删除在应用程序上设置的隔离扩展属性:

  1. 将应用移至“应用程序”文件夹
  2. 打开Terminal.app,然后粘贴并执行以下命令:

xattr -d com.apple.quarantine /Applications/Visual\ Studio\ Code.app

如果Right Click>Open打不开Visual Studio代码:

另一种选择可以简单地导航到 System Preferences > Security & Privacy

General 选项卡中,导航并单击 旁边的 Open Anyway 按钮("Visual Studio Code" 已被阻止使用,因为它不是来自已识别的来源).

Security & Privacy

这个的官方问题是microsoft/vscode issue 74782 "Investigate: macOS notarization"

但是,as noted in January 2020 iteration 对于 VSCode 1.42:

Extremely disappointed to see that #74782 won't be fixed until early February.

(应该是possibly done for January

First it was supposed to be fixed in November, then in December, and now it slips all the way to February.
This, for a feature (app notarization) first announced in 2018, for an operating system (Catalina) that has been available in beta for > six months and which went Gold in October, and which anyone who has purchased a new Mac since has no choice but to run.

Yes, I realize there is a workaround to install on macOS Catalina, but I don't want to install a non-hardened app. Every other app I've needed / wanted to install on my new Mac was hardened and notarized on a timely basis.

编辑:2 月。 2020,现在 VSCode 1.42 已经发布,vscode commit c196df9 from João Moreno is supposed to solve this issue; from PR 86588.
João adds:

Starting next week, insider builds should be properly notarized. ✔️

(下一个 1.43 版本"insider builds")

VSCode 1.43 确实提到:

Notarized macOS Builds

Visual Studio Code for macOS is finally notarized, so you should no longer see the following dialog:

Read the investigation issue and Apple's developer documentation for more details.