April 29th, 2020
People constantly post on Apple’s developer forums complaining that when they try to install Xcode, an alert opens saying they don’t have enough disk space to install it. These people always say they have enough space because they have more free space on their disk than the Xcode download. Usually the person asking the question has 15–20 GB of free space on their startup disk.
The Xcode file that you download is a compressed file. You need enough disk space to store both the compressed file you downloaded and the expanded file. Suppose your Xcode download is 8 GB. The expanded file is going to be bigger than that. Xcode 11.4.1 takes up 17.39 GB on my Mac. At this point you need 25.39 GB of free space. Add in some temporary storage space for swapping files, and you need a minimum of 30 GB of disk space to install Xcode.
If an alert opens saying you don’t have enough space to install Xcode, you don’t. Make sure you have at least 30 GB of free space. Xcode releases get bigger with each new release so you may need 40–50 GB in the future.
The app DevCleaner for Xcode can free up gigabytes of disk space by removing caches and other old files that accumulate over time.