Applicable to: Xcode ≤ 14.x
If you install Xcode on a Hackintosh it's usually for compiling Kexts. Unfortunately, the Xcode app is pretty hefty in terms of size – about 30 GB. That's because it contains code for building Apps for the whole line-up of Apple devices: AppleTV OS, iPhone OS, WatchOS and macOS, of course. Since you only need the macOS part for compiling Kexts, you can delete the rest and then you are left with about 5 GB. Needless to say you shouldn't delete platforms you are a actually developing for…
Note
With the release of Xcode 15, Apple finally debloated the app a lot. After installing the base app, it asks you which platform(s) you want to develop for and then downloads additional files (if required).
- Quit Xcode if it is running
- Right-click on the Xcode app and select "Show Package Contents"
- Navigate to
Contents/Developer/Platforms
: - Delete the following folders:
- AppleTVOS.platform
- AppleTVSimulator.platform
- iPhoneOS.platform
- iPhoneSimulator.platform
- WatchOS.platform.platform
- WatchSimulator.platform
- Empty the trash bin
Once I removed the unnecessary platforms the Xcode.app was only about 5 GB.