How to completely uninstall vscode on mac

MacosVisual Studio-CodeUninstallationOsx Elcapitan

Macos Problem Overview


I need to clean install vscode on my mac. I opened the terminal and removed the .vscode/ from ~. I also delete the Visual Studio Code.app/ from /. However, after deleting all that and download a fresh copy, I installed and open the editor and the editor remembered the last project I had. For me, that means that it is something else I need to delete but I can't find it. I went to the documentation but can't find anything about uninstalling the editor. Does anyone know how to completely uninstall VSCode from mac?

What I have tried

Following this instructions and new installation of vscode keeps remembering the last project I opened.

https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/#Using_the_Uninstall_Script

Macos Solutions


Solution 1 - Macos

Here are all the places where VSCode stores stuff on Mac OS X, besides the Visual Studio Code.app itself, which is in your Applications folder:

rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist 
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist 
rm -fr ~/Library/Caches/com.microsoft.VSCode
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/
rm -fr ~/Library/Application\ Support/Code/
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/.vscode/

Update (Feb 2020): There are potentially also hidden extension directories in your home directories. To get rid of everything make sure you look for those too. They start with .vscode-.

Please run this command with care. Maybe you want to keep extension directories.

rm -rf ~/.vscode*

Solution 2 - Macos

The solution to my problem was to cd to the following path... /Users/<user>/Library/Application\ Support and delete the folder called Code. That folder contains all the setting and is not overwrite with a new installation. Looking through the entire file structure, VSCode name folder different. Sometimes folders are called .vscode/, or code/, or Visual Studio Code.app.

Solution 3 - Macos

This worked for me ( VS Code 1.30 with MacOS - High Sierra 10.13.6 )

Step 1:

Close VS Code

Step 2:

rm -rf $HOME/Library/Application\ Support/Code

Step 3:

rm -rf $HOME/.vscode

Step 4:

Remove VSCode from application

Step5:

Reinstall VS Code if needed

Solution 4 - Macos

If using a 3rd-party application is OK, check out App Cleaner.

It basically does the same thing as the other answer, but via a GUI and you don't have to manually remove all files/dirs one-by-one. Just drag VS Code from the Applications folder into App Cleaner, then it will find all the related files for you, and then you just have to click on the Remove button.

App Cleaner

UPDATE (VS Code 1.46)

Based on a recent comment, even after using AppCleaner, re-installing VS Code seems to still "remember" your previous extensions. This is caused by a ~/.vscode/extensions folder, which for some reason, AppCleaner can't "see" and is not listed in its UI. You will have to remove this folder manually.

~$ find ~/. -maxdepth 1 -name .vscode -type d
/Users/gino/./.vscode

~$ ll /Users/gino/./.vscode/extensions
total 0
drwxr-xr-x  15 gino  staff   480B Jun 30 14:14 dbaeumer.vscode-eslint-2.1.5/
... (all other extensions) ...

~$ rm -Rf /Users/gino/./.vscode

Solution 5 - Macos

Here is my approach:

  1. Open finder
  2. Click on Home icon(which has your username as label)
  3. Click on Library Folder. Note Library folder may be hidden, so you will need to click on Shift+CMD+. to open hidden files and folders.
  4. Click Application Support folder
  5. Find Code folder beneath Application Support and delete it(You delete Code Folder of course)

Solution 6 - Macos

The homebrew cask code for VSCode provides a nice list of all the folders that you have to delete manually after moving the app itself into the trash:

- ~/.vscode
- ~/Library/Application Support/Code
- ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl*
- ~/Library/Caches/com.microsoft.VSCode.ShipIt
- ~/Library/Caches/com.microsoft.VSCode
- ~/Library/Preferences/ByHost/com.microsoft.VSCode.ShipIt.*.plist
- ~/Library/Preferences/com.microsoft.VSCode.helper.plist
- ~/Library/Preferences/com.microsoft.VSCode.plist
- ~/Library/Saved Application State/com.microsoft.VSCode.savedState

Solution 7 - Macos

I lost my old mac and had to reinstall vscode on my new mac. I thought I had lost all of my extensions but when I logged on the vscode they all seem to be stored on my vscode account. I don't know if that will make a difference.

Solution 8 - Macos

If these steps are not enough, like for me, please consider removing these file and directory:

  • /usr/local/Caskroom/visual-studio-code
  • /usr/local/Library/Taps/caskroom/homebrew-cask/Casks/visual-studio-code.rb

Run in a shell the following commands to check for others file or directories:

  • locate visual-studio-code
  • locate vscode
  • locate code

Bye.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionredeemefyView Question on Stackoverflow
Solution 1 - Macosj7nn7kView Answer on Stackoverflow
Solution 2 - MacosredeemefyView Answer on Stackoverflow
Solution 3 - MacosviruView Answer on Stackoverflow
Solution 4 - MacosGino MempinView Answer on Stackoverflow
Solution 5 - MacosHakim AsaView Answer on Stackoverflow
Solution 6 - MacosJagmitView Answer on Stackoverflow
Solution 7 - MacosT L CView Answer on Stackoverflow
Solution 8 - MacostrashymsView Answer on Stackoverflow