Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 801
Yv Zuo Avatar asked Feb 06 '20 16:02

Yv Zuo


People also ask

Is it safe to delete Xcode from MAC?

More than just wasting space, the junk can slow Xcode down, sometimes making it non-responsive. When this happens, you need to clean Xcode by completely removing old cache files and the app itself before doing a fresh Xcode install. If you think you don't need help uninstalling Xcode, think again.

How do I delete files in Xcode?

In Xcode 2.4, you select the file in the main project window and either press the delete/backspace button, or control-click and select Delete from the pop-up menu. It then asks if you want to delete the file and all references to it, or just the references, leaving the file still present in the project folder.

How to delete a project folder in Xcode?

Close xcode first then open it again , at rigght menu you will see name of your project , clikc on on 'show on finder' .Then delete the project folder

Can I delete Xcode?

Can I delete Xcode? What will doing so break? How can I delete Xcode gracefully? Show activity on this post. Yes, you can, as long as you install the command line tools.

How do I find an app file in Xcode?

Alternatively, in Xcode, using the Navigator (left pane), expand the group "Products", right-click on the .app file and choose "show in finder". An optional, albeit a bit clumsy, method is to make a change to a given project and then use the Finder to locate files modified in that time span. See Xcode Help for various details on it's use.

Can I run Xcode from the command line?

Yes, you can, as long as you install the command line tools. You can then install the command line tools with xcode-select --install You must log in to answer this question.


2 Answers

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.

like image 127
Drew Westcott Avatar answered Oct 13 '22 00:10

Drew Westcott


Yes you can delete platforms from this folder

but make sure that you remove a platform and the simulator, otherwise Xcode will refuse to restart after

Example for Ios watch : remove WatchOS.platform and also WatchSimulator.platform

like image 40
Chakib Temal Avatar answered Oct 12 '22 23:10

Chakib Temal