Skip to content

Instantly share code, notes, and snippets.

@junian
Last active January 25, 2019 22:04
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save junian/46a924889fe58ef1b02f73b8f8584366 to your computer and use it in GitHub Desktop.
Save junian/46a924889fe58ef1b02f73b8f8584366 to your computer and use it in GitHub Desktop.
Uninstall Visual Studio for Mac
#!/bin/sh
# based on guide from Microsoft https://docs.microsoft.com/en-us/visualstudio/mac/uninstall
# Uninstall Visual Studio for Mac
echo "Uninstalling Visual Studio for Mac ..."
sudo rm -rf "/Applications/Visual Studio.app"
rm -rf ~/Library/Caches/VisualStudio
rm -rf ~/Library/Preferences/VisualStudio
rm -rf "~/Library/Preferences/Visual Studio"
rm -rf ~/Library/Logs/VisualStudio
rm -rf ~/Library/VisualStudio
rm -rf ~/Library/Preferences/Xamarin/
# Uninstall Mono SDK (MDK)
echo "Uninstalling Mono SDK (MDK)..."
sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
sudo rm -rf /etc/paths.d/mono-commands
# Uninstall Xamarin.Android
echo "Uninstalling Xamarin.Android ..."
sudo rm -rf /Developer/MonoDroid
rm -rf ~/Library/MonoAndroid
sudo pkgutil --forget com.xamarin.android.pkg
sudo rm -rf /Library/Frameworks/Xamarin.Android.framework
# Uninstall Xamarin.iOS
echo "Uninstalling Xamarin.iOS ..."
rm -rf ~/Library/MonoTouch
sudo rm -rf /Library/Frameworks/Xamarin.iOS.framework
sudo rm -rf /Developer/MonoTouch
sudo pkgutil --forget com.xamarin.monotouch.pkg
sudo pkgutil --forget com.xamarin.xamarin-ios-build-host.pkg
# Uninstall Xamarin.Mac
echo "Uninstalling Xamarin.Mac ..."
sudo rm -rf /Library/Frameworks/Xamarin.Mac.framework
rm -rf ~/Library/Xamarin.Mac
# Uninstall Workbooks and Inspector
echo "Uninstalling Workbooks and Inspector ..."
sudo /Library/Frameworks/Xamarin.Interactive.framework/Versions/Current/uninstall
# Uninstall the Visual Studio Installer
echo "Uninstalling the Visual Studio Installer ..."
rm -rf ~/Library/Caches/XamarinInstaller/
rm -rf ~/Library/Caches/VisualStudioInstaller/
rm -rf ~/Library/Logs/XamarinInstaller/
rm -rf ~/Library/Logs/VisualStudioInstaller/
rm -rf ~/Library/Preferences/Xamarin/
rm -rf "~/Library/Preferences/Visual Studio/"
echo "Finished all Uninstallation process."
@bbl-Laobu
Copy link

Thanksfor this Junian.
I was wondering, where are the Android AVD's deleted with this script? After a little research I discovered that they can be found in the hidden folder ~/.android/. Is it worth adding this?

@backpacked
Copy link

Just the thought I had when I was reading the instructions @ https://docs.microsoft.com/en-us/visualstudio/mac/uninstall and then I read your comment. You saved me a lot of work. Thanks!

@junian
Copy link
Author

junian commented Jun 3, 2017

@bbl-Laobu I usually remove the avd located at ~/.android/avd
You can safely remote that folder to delete all AVDs.

@junian
Copy link
Author

junian commented Jun 3, 2017

@backpacked you're welcome. They should add official script to remove, tho.

@jaredleviwalton
Copy link

also need to add :
sudo rm -rf "/Applications/Xamarin Profiler.app"
rm -rf ~/Library/Developer/Xamarin
rm -rf ~/.android

@lfallo1
Copy link

lfallo1 commented Jul 5, 2017

Amazing I needed to get this from here. But, I appreciate it. Freed up 3GB for me.

@Yuancong97
Copy link

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment