142

I have downloaded Visual Studio Code for the first time but I keep getting message below:

apple error message when clicking on VSC app

"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.

My MacBook is up to date, and I even updated the latest version of VSC on their website (September 2019 (version 1.39); there is none for October) but it still gave me the same message.

Looking into their FAQ, I read about reinstalling VS Code. I did that but it still doesn't work.

Community
  • 1
  • 1
Jennifer Espinoza
  • 1,433
  • 2
  • 6
  • 6
  • 8
    Note to close voters: take another look at the part in the close reason where it says "unless they directly involve tools used primarily for programming." – John Montgomery Oct 25 '19 at 23:55
  • Q1 2020: This is fixed for the next VSCode 1.43, as documented in [my answer below](https://stackoverflow.com/a/59592247/6309). – VonC Feb 07 '20 at 15:46

5 Answers5

320

macOS Catalina requires apps to be notarized by Apple. Your version of Visual Studio Code is yet to be updated by Microsoft for the new OS.

Please try the following:

Right-click on the app and select Open.

If this did not work, remove the quarantine extended attribute that’s set on the app:

  1. Move the app to the Applications folder
  2. Open Terminal.app, then paste and execute the following command:

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

Tzar
  • 5,132
  • 4
  • 23
  • 57
  • 2
    Straight away this didn't work for me however after executing this command I needed to explicitly double click on VSCode application. – Siva Tumma Feb 22 '20 at 00:28
49

If Right Click > Open doesn't open Visual Studio Code:

Another alternative can be simply navigating to System Preferences > Security & Privacy.

In the General tab, navigate and click Open Anyway button next to ("Visual Studio Code" was blocked from use because it is not from an identified source).

Security & Privacy

Miko
  • 503
  • 3
  • 9
  • 1
    Changing `System Preferences > Security & Privacy` option once is more convenient than using CLI `xattr` each time. Thank you! – demisx Dec 02 '19 at 18:28
  • 2
    This approach fixed the problem for me on my new Mac book pro 16 – Taylor Maxwell Jan 04 '20 at 16:41
  • 4
    THIS IS MUCH THE BEST ANSWER. When right-click->Open fails, this action is exactly the authorization you want using the exact MacOS operation for the problem. You should not use `xattr` commands whose effects may not tie in to the overall security system. – Andrew Wolfe Jan 09 '20 at 13:51
  • this is the right way of doing it :) more user friendly.... – Emrah Mehmedov Dec 26 '22 at 08:38
6

The official issue for this is microsoft/vscode issue 74782 "Investigate: macOS notarization"

But, as noted in January 2020 iteration for VSCode 1.42:

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

(it was supposed to be 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.

Edit: Feb. 2020, now that VSCode 1.42 has been released, 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. ✔️

("insider builds" for the next 1.43 version)

VSCode 1.43 does mention:

Notarized macOS Builds

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

Notarization

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

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

In my case non of the above worked.

I simply deleted vscode from my applications folder ('move to trash') and reinstall. worked like magic! When I opened vscode all my work was still there :)

Hila Grossbard
  • 521
  • 7
  • 20
0

If anyone is looking solution for mac Ventura then open the terminal and type sudo spctl --master-disable. Hit enter and provide the Mac password. Now go to your privacy & security, scroll down, and there you will see the option of anywhere in the security menu. Select anywhere and thats it.

Muhammad Umair Saqib
  • 1,287
  • 1
  • 9
  • 20