Warm tip: This article is reproduced from serverfault.com, please click

Can I delete the Platforms under Xcode.app/Contents/Developper/?

发布于 2020-02-06 16:48:42

My Mac is running out of disk. I searched for large files and directories and found the directory /Applications/Xcode.app/Contents/Developer/Platforms takes about 20GB of my disk.

ls -l
total 0
drwxr-xr-x  10 root  wheel  320 Dec 18 14:37 AppleTVOS.platform
drwxr-xr-x   7 root  wheel  224 Dec 18 15:10 AppleTVSimulator.platform
drwxr-xr-x   8 root  wheel  256 Dec 18 14:44 MacOSX.platform
drwxr-xr-x  10 root  wheel  320 Dec 18 15:10 WatchOS.platform
drwxr-xr-x   7 root  wheel  224 Dec 18 15:10 WatchSimulator.platform
drwxr-xr-x  10 root  wheel  320 Dec 18 15:10 iPhoneOS.platform
drwxr-xr-x   8 root  wheel  256 Dec 18 15:10 iPhoneSimulator.platform

I looked at the names of the folders, which are seemingly simulator, aka virtual machine, for different Apple operating systems.

I am a stranger in Apple os development and share no interest in it. I only write c, java, python, html and all that with my Mac. Can I delete these unnecessary files? Or should I keep the MacOSX.platform at least?

Questioner
Yv Zuo
Viewed
0
Drew Westcott 2020-02-09 22:36:12

Don Mag advice is good.

I would not remove anything from the /Applications/Xcode.app folder as this could cause you issues running Xcode.

There is a folder in ~/Library/Developer though that stores downloaded version of the DeviceSupport for any version of iOS/tvOS/watchOS etc that you have been developing for. Every time an OS is updated another download appears in these folders and older version are not removed automatically.

Any of these can be removed as they will download again automatically the next time you build to an OS version. Though bear in mind the extra wait time needed on the first build of an uncache version.

I use an App from the App Store called 'DevCleaner' which allows me to select any DeviceSupport files, Archives (I tend to keep these) and Derived data. It's useful as it shows how much space each folder is taking up.

I select everything but the latest versions of the OSes I am developing for.

Hope that helps.