如何从Mac上完全删除Visual Studio?


10

我刚在Mac发行后的第二天就安装了Visual Studio for Mac。它消耗了20 GB的磁盘空间,因此我决定将其删除。我进入了应用程序文件夹,并将与安装相关的最近安装的组件移到了废纸.。但是它根本没有释放任何空间。因此,我在线搜索并单击以下链接进行卸载:卸载Xamarin

跟随链接并输入所有终端命令后,我只能释放10 GB的存储空间。如何释放剩余的10 GB存储空间?

Answers:


25

如果有人有相同的问题,请访问官方指南

以下是引自2017-4-14更新的原始指南的内容。

卸载Visual Studio for Mac App

步骤1.在/ Applications目录中找到Visual Studio.app,并将其拖到垃圾箱。或者,右键单击并选择移至废纸.。

步骤2.删除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/VisualLodStudio

解除安装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 

卸载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

解除安装Xamarin.Mac

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

卸载工作簿和检查器

sudo /Library/Frameworks/Xamarin.Interactive.framework/Versions/Current/uninstall

卸载Visual Studio安装程序

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

卸载Mono SDK(MDK)

警告

Xamarin之外还有其他使用Mono的应用程序,例如Unity。在卸载Mono之前,请确保它没有其他依赖项。

sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg

其他应用名称为Xamarin

官方指南没有提及它,但是我发现我的库目录中还有其他名为Xamarin.xxxx的应用程序。我只是将它们移至垃圾箱。


@ DavidPostill♦@ Pierre.Vriens添加引号。
lowatt

好多了。但是,您需要对所有内容进行引用。请阅读如何参考他人撰写的材料。您必须阻止其他人编写的引用文本。请参阅Markdown帮助。这次我们已为您修复了该问题,但以后请注意这一点。
DavidPostill

1
谢谢你!我还~/Library/Developer/Xamarin/占用了10+ GB。
马特·哈金斯

10

也许这将是更好的解决方案(无需执行每个步骤):https : //raw.githubusercontent.com/MicrosoftDocs/visualstudio-docs/master/mac/resources/uninstall-vsmac.sh

#!/bin/sh

# 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/
rm -rf ~/Library/Developer/Xamarin

# 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 for Mac Installer
echo "Uninstalling the Visual Studio for Mac Installer..."

rm -rf ~/Library/Caches/XamarinInstaller/
rm -rf ~/Library/Caches/VisualStudioInstaller/
rm -rf ~/Library/Logs/XamarinInstaller/
rm -rf ~/Library/Logs/VisualStudioInstaller/

# Uninstall the Xamarin Profiler
echo "Uninstalling the Xamarin Profiler..."

sudo rm -rf "/Applications/Xamarin Profiler.app"

echo "Finished Uninstallation process."

如果您以前没有处理过bash脚本,则也可以查看其文档:https : //docs.microsoft.com/zh-cn/visualstudio/mac/uninstall

实际上,这很容易。创建扩展名为.sh的文件(例如vsremover.sh),然后粘贴上面的代码。救。打开终端应用程序,转到保存文件的位置(例如:),cd /Users/yourname/Desktop然后键入以下内容:

chmod +x vsremover.sh

然后运行它:

./vsremover.sh
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.