Why is Xcode so big on a Mac?

If you’ve installed Xcode on your Mac and only just discovered how much space it’s taking up on your boot drive, you may be wondering why it’s so large. Or maybe you’ve tried to download it and got an error telling you that you don’t have enough space to install it and can’t work out why Xcode is so big. In this article, we’ll answer that question and also tell you what you can do to reduce the amount of space it takes up.

What is Xcode?

Xcode is Apple’s integrated development environment (IDE) for creating software for macOS, iOS, iPadOS, and tvOS. It supports source code for the most popular languages, including Apple’s own Swift, C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, and Ruby. It’s free to download from the App Store and can be used for most of the development process, including creating the user interface, writing code, compiling it, and then testing and debugging. Once it’s complete, Xcode can be used to submit apps to Apple’s App Store. That’s the only part of the process for which you will need to be a registered developer. If you want to use Xcode to learn new skills or improve existing ones, or just for fun, it’s free.

How much space does Xcode need?

On the App Store page for Xcode, it lists the size of Xcode 12.5 as 11.7GB. However, when you try and install it, you’ll get an error message unless you have at least 40GB of free space. However, that 40GB isn’t the full story. As you use Xcode, and specifically, as you connect more devices running different OS versions, Xcode will grow and grow in size and can easily take up much more than that 40GB. So, the answer to the question ‘how much space does Xcode need?’ is at least 40GB, but beyond that, it depends on how you use it.

Why is Xcode so large?

Xcode supports four different operating systems, iOS, iPad OS, macOS, and tvOS. And for each of those, it supports multiple versions. Each OS has simulator runtimes, libraries, compilers, and software development kits. It has a ton of data about declarations supported in each operating system. That’s why it’s so huge.

How to make Xcode take up less space

Every time you connect a device with a new version of an Apple OS running on it, even if it’s only a 0.1 upgrade, Xcode adds more data and grows larger. And many developers have noted that it never seems to remove any of that data. So Xcode continues to grow and grow. An effective way to reduce the amount of space Xcode uses is to remove the data associated with old versions of operating systems that you no longer need. However, that’s easier said than done. Here’s how to do it.

  1. In the Finder, navigate to the Go menu and choose Go to Folder.
  2. Type: ~/Library/Developer
  3. Look for the folder called iOS DeviceSupport and open it
  4. You will see it has separate folders for each version of iOS. Drag them all to the Trash.
  5. Look for the folder in ~/Library/Developer called iPad OS DeviceSupport and repeat step 4.
  6. Empty the Trash.

You should have removed several gigabytes of data. The next time you connect an iOS or iPad OS device and use Xcode, it will download the libraries it needs for the version of iOS or iPad OS the device is running. So there is no danger in removing those folders.

You can also remove devices and simulators you don’t need one at a time from within Xcode.

  1. In Xcode, click the Window menu.
  2. Choose Devices and Simulators.
  3. Click a simulator you want to remove and choose Delete.

You can also clear the cache associated with a project by opening the project and pressing Command + Shift +K. That will free up some space and fix any problems you are having with the project crashing.

An easier way to reduce the amount of space Xcode uses

CleanMyMac X - Xcode junk in System Junk module

CleanMyMac X has several tools that make it easy to free up space on your Mac. One of them is System Junk. It identifies files like language files you don’t use, user cache files, old updates, and other junk files put on your Mac by the system. Here’s how to use it.

  1. Download and install CleanMyMac X.
  2. Launch CleanMyMac X from your Applications folder.
  3. Choose System Junk and press Scan.
  4. When it’s finished, choose Review Details.
  5. Select Xcode Junk and press Clean.

When you select Xcode Junk, you’ll notice that to the right of its name, CleanMyMac X tells you how much space will be cleared when you remove it. And in the right-hand window, you’ll see a list of folders and their sizes. CleanMyMac X is excellent at identifying what files can be safely removed, and you can keep its default settings without any concerns. However, you are always in control and can choose to keep specific files or folders.

Xcode is an integrated development environment for creating software for macOS, iOS, iPadOS, and tvOS. It can be used to code in Swift, C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, and Ruby. While the download size from the App Store is only just under 12GB, once you start using it, the amount of space it needs grows and grows. However, if you follow the steps above, you will be able to reduce that considerably. And if you use CleanMyMac X, it will be both quick and easy.

Laptop with CleanMyMac
CleanMyMac X

Your Mac. As good as new.