59

I have VS Code on Windows and macOS, on Windows it auto updates but on macOS it doesn't.

How do I get VS Code to auto update on macOS?

12 Answers 12

135

VS Code on macOS will not auto update if it's running from a read-only folder.

If you downloaded and are running VS Code from your Downloads folder, which is read-only, it will not auto update.

Solution:

When you've downloaded VS Code, drag the downloaded file to your applications directory and run it from there instead.

enter image description here

It will now auto update

Thanks to @gino mempin in the answer to my previous question for the inspiration How to turn on auto search on VS Code on macOs?

Sign up to request clarification or add additional context in comments.

9 Comments

This is not working for me. I've confirmed VS Code is in fact in my Applications folder, yet I continue to get the "Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. See this link for more information." warning.
@MarkGavagan try quitting Visual Studio Code, finding it in the Applications folder, holding down the command key ⌘ while dragging it to the Downloads folder, then dragging it back to the Applications folder. Mine was able to update after that, see: github.com/microsoft/vscode/issues/27928#issuecomment-306382650
Dragging from Downloads to Applications + restarting vscode worked for me.
Make sure to quit VS Code, not just close it.
This one work for me: Dragging VS code from download to application folder.
|
91

In case anyone encounter this and VS Code was already in your Applications Folder...

  1. Quit VS Code in case it was running (make sure with CMD⌘+Q)
  2. Hold CMD⌘ + drag (so that it moves the app instead of making a shortcut) the VS Code app back to the Downloads folder.
  3. Hold CMD⌘ + drag the VS Code app back to the Applications folder.
  4. Now update should be possible :)

3 Comments

I was like its already in application folder but its not working :D. Thanks man
After doing all the steps above, I still hafdto restart my MacBook to make the updates available.
I tried the other solutions, even moving the application using terminal, but this is the only answer that worked for me
21

I solved my problem with this command:

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

source: naveendhanaraj.wordpress.com

Comments

12
  1. Right-click on the app and locate it in finder:

enter image description here

  1. And drag-n-drop to the Applications folder.

  2. Restart VSCode

1 Comment

probably the easiest way of navigating.
6

2 ways of resolution:

  • Way 1

Drag the vscode app icon from downloads to application if you have downloaded fresh

  • Way 2

Hold CMD key and drag the vscode app icon from application to download and back to application

Way 2

1 Comment

My VSCode is already in the Applications folder but I still encounter error. I used 'Way 2' and it worked. I don't know why but it worked.
2

Moving VSCode to Applications folder and then restarting Mac worked for me.

Comments

2

Solution if @StudioTime's solution is not working:

Terminal:

sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/* xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app 

Comments

2

I was having the same issue even though my VS Code was in Applications folder. To solve the issue:

~ Exit the VS Code if open.

i. I moved the VS Code from Applications folder to Downloads folder completely (make sure you move it and not just create a copy of it. You can do that using command key file moving the VS Code)

ii. Moved the VS Code back from Downloads folder to Applications folder.

iii. Open the VS Code back again.

2 Comments

This worked for me perfectly! I am on Sonama 14.3 and the app was in Applications folder and yet I was getting: Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. This might mean the application was put on quarantine by macOS. See this link for more information.
moving back and forth works for me
2
  1. Open Settings
  2. Privacy & Security
  3. Select Full Disk Access
  4. Check VS code then restart VS code and try install updates

Comments

1

For mac os : Close the vs code application. Search for the file Visual Studio Code.app in finder and drag and drop it in Applications. Reopen the vscode from Applications and now "check for updates" works.

2 Comments

This is already mentioned in other answers.
It works for me
1

You can also do the following :

  • Go to Settings

  • Type "update mode" in the search bar

  • Ensure that "Update: Mode" is NOT set as "none"

Then "Check for Updates..." would be in the "Code" menu.

1 Comment

This worked for me, thanks! I don't know why it was downvoted.
0

macOS may assign a quarantine attribute to downloaded applications to protect users from potentially harmful software. This attribute can prevent applications from performing certain actions, including auto-updating.

You can drag the application back to Downloads if it's already in Applications and then to Applications to clear this flag, or you can run this command:

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

This command is used to remove the quarantine attribute from VS Code. By running this command, you are explicitly clearing any quarantine flags that may be preventing the application from updating properly.

Do note that moving the file or running this command is technically circumventing builtin safeguards and if your downloaded app in fact is NOT visual studio code, you may expose yourself to malware. It may be in your best interest to delete the app if it's not updating properly and re-download the software from the trusted distributer, verify the checksum if available and then retry the dragging or xattr method if needed.

So, if VS Code is in the Applications folder but still has issues with updating, it’s possible that the quarantine state or related file system attributes are the cause. Clearing these attributes with the xattr command or by moving the file should help resolve the problem, but do make sure you are working with the correct file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.