Xcode was born as the development environment for MAC OS X. Over the years, new developer platforms were added. First, there was iOS. After a few years, watchOS was added, and, lastly, tvOS. Each of the new development platforms came bundled with a corresponding simulation platform. As a result, the latest Xcode version is more than 9GB big. That is a lot of space if you, like me, only have a 120GB Mac Book air.
Just after the advent of the iPhone developer platform, it was possible to choose which platform to download during the Xcode installation. After Xcode was moved to the App store, that convenient option disappeared. Why not include the platforms in the download section of Xcode preferences?
In the meantime, the “Brute Force” approach can be used to slim down Xcode.
Go to the application folder, right-click on Xcode and choose Show Package Content. This opens a finder window. Navigate into Contents->Developer->Platforms
Select all the platforms you don’t need and move them to the Trash.
After emptying the Trash you will get a lot of free space back. I deleted the watchOS and tvOS platforms, and the corresponding simulators, which gave me back almost 3Gb of space.
I didn’t have any problems with Xcode after the slim-down process, but there is a chance that the platforms are not completely independent. If you have any problems, just erase Xcode and download it again from the App store.
If you get an error while emptying the Trash , you might need to ‘force erase’ it from the terminal app. The command you need to use is very dangerous! Make a small syntax mistake and you can wipe out ALL of your data!!! I decline any responsibility for lost data. Just in case, back up everything! The command is
sudo rm -rf .Trash/*