Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I completely remove new Microsoft Visual Studio for Mac?

I recently installed Visual Studio for Mac right after the day it was launched. It consumed 20 gb of my disc space, so I decided to remove it. I went in to the applications folder and moved recently installed components associated with the installation to the trash. But it did not free any space at all. So I searched online and followed the following link for uninstallation: Uninstalling Xamarin

After following the link and entering all the terminal commands, I was only able to free up 10 gb of storage. How do I free up the rest 10 gb of the storage ?

like image 486
Shrijan Aryal Avatar asked Nov 28 '22 16:11

Shrijan Aryal


1 Answers

Current version Of MS VS takes 20GB on a macOs drive.

Please read the script to avoid removing shared stuff like Mono, NuGet & Visual Studio Code traces if it is needed by another app on your Mac.

Following script will free 20GB of space. Just put it in "uninstall.sh" file and run via terminal as "sudo ./uninstall.sh" (Do not forget to set to set execute permission on the file):

#!/bin/bash
# Complete uninstall Microsoft Visual Studio (Xamarin) including Mono and Microsoft NuGet traces:

# Uninstall Xamarin Studio
rm -rf "/Applications/Xamarin Studio.app"
rm -rf "/Applications/Xamarin Profiler.app"
rm -rf "/Applications/Xamarin Workbooks.app"
rm -rf ~/Library/Caches/XamarinStudio-*
rm -rf ~/Library/Logs/XamarinStudio-*
rm -rf ~/Library/Preferences/XamarinStudio-*
rm -rf ~/Library/XamarinStudio-*
rm -rf ~/Library/Caches/Xamarin
rm -rf ~/Library/Caches/VisualStudio
rm -rf ~/Library/Developer/Xamarin
rm -rf ~/Library/Developer/XamarinStudio
rm -rf ~/Library/Developer/VisualStudio
rm -rf ~/Library/Logs/Xamarin
rm -rf ~/Library/Logs/VisualStudio
rm -rf ~/Library/Preferences/Xamarin
rm -rf ~/Library/Preferences/VisualStudio
rm -rf ~/Library/Xamarin
rm -rf ~/Library/MonoAndroid
rm -rf ~/Library/XamarinStudio-*
rm -rf ~/Library/VisualStudio
rm -rf ~/Library/Application\ Support/XamarinStudio-*
rm -rf ~/Library/Application\ Support/VisualStudio
rm -rf ~/.templateengine/Visual\ Studio
rm -rf ~/.share/Xamarin
rm -rf ~/.local/share/Xamarin

sudo rm -f /private/var/db/receipts/com.xamarin.*
sudo rm -f /private/var/db/receipts/xamarin.*

# Uninstall Mono MDK
# You will also want to make sure that there are no other dependencies on Mono
sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
rm -rf ~/.local/share/MonoForAndroid
rm -rf ~/.config/.mono
rm -rf ~/.android

# Uninstall Xamarin.Android
sudo rm -rf /Developer/MonoDroid
sudo rm -rf /Library/Frameworks/Xamarin.Android.framework
sudo pkgutil --forget com.xamarin.android.pkg
rm -rf ~/Library/MonoAndroid

# Uninstall Xamarin.iOS
rm -rf ~/Library/MonoTouch
sudo rm -rf /Library/Frameworks/Xamarin.iOS.framework
sudo rm -rf /Developer/MonoTouch
sudo rm -rf /Developer/MonoAndroid
sudo pkgutil --forget com.xamarin.monotouch.pkg
sudo pkgutil --forget com.xamarin.xamarin-ios-build-host.pkg

## To Uninstall the Xamarin Build Host
 sudo rm -rf "/Applications/Xamarin.iOS Build Host.app"

## To unload and remove the Xamarin Build Host launchd job
 launchctl unload /Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist
sudo rm -f /Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist

# Uninstall Xamarin.Mac
sudo rm -rf /Library/Frameworks/Xamarin.Mac.framework
rm -rf ~/Library/Xamarin.Mac
sudo rm -rf /Library/Frameworks/Xamarin.Interactive.framework

# Uninstall Xamarin Installer
rm -rf ~/Library/Caches/XamarinInstaller/
rm -rf ~/Library/Logs/XamarinInstaller/
rm -rf ~/Library/Preferences/Xamarin/

# Uninstall Microsoft NuGet
rm -rf ~/.local/share/NuGet
rm -rf ~/.config/NuGet
rm -rf ~/.config/.NuGet
rm -rf ~/.NuGet

# Uninstall traces of visual studio code
rm -rf ~/.vscode
like image 195
Ivq Avatar answered Dec 06 '22 09:12

Ivq