37

Is there anyway to reduce the disk space used to store the Xcode application? I only downloaded Xcode so that I could compile C and C++, so if possible I would like it to take up much less than the 9.22GB it requires right now. Perhaps there are optional portions I can uninstall?

42

Although it's not directly related to the Xcode app size. There are multiple places where you can delete files to free up some space.

1. Derived Data Xcode keeps data about your projects which includes index, build output and logs. Go to ~/Library/Developer/Xcode/DerivedData/ and delete the folders for projects that you no longer need to keep this data around for.

2. iOS Device Support Xcode is storing information about the devices you have used for development. Delete the data no longer needed in ~/Library/Developer/Xcode/iOS DeviceSupport/.

3. Archives Delete the one’s you don’t need in the Organizer, or go to ~/Library/Developer/Xcode/Archives/ to delete them in bulk. Be careful not to delete archives for which you still need the dSYM data for debugging.

4. Simulators Simulators are stored under ~/Library/Developer/CoreSimulator/Devices. For each version of iOS you are building for.

5. Documentation Browse and delete unnecessary data under ~/Library/Developer/Shared/Documentation/DocSets.

  • 2
    I only have 3 folders in Xcode: DerivedData,iOS Device Logs, and UserData. The first two folders are zero KB, and UserData is only 8KB. I do not have a CoreSimulator folder in Developer. I already deleted the DocSets, which were taking up an additional ~2.5GB on top of the 9.22 that Xcode is using. – spacetyper Jun 19 '17 at 16:26
18

Perhaps a more elegant solution would to be use the command line tools instead of Xcode.

You could delete Xcode entirely (or skip the install). Instead of downloading and installing Xcode - open the command line (terminal app works out of the box) and type gcc.

That will pop up a window where you can install the command line tools. Click install, click agree and the C compilers and libraries and debuggers will all download and install.

On 10.11 the command line tools take about 200 MB of disk space. The dmg to install the Xcode 9 version beta command line tools is less than that as well, so it’s a pretty slim set of tools if you want to preserve disk space and can use another IDE / editor and don’t need all the features Xcode provides.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .