Xcode on Mac App Store can't install , show disk space not enough
What you can also do is manually download Xcode and install it.(Without using the app store update)Therefor do the following steps:
- go to https://developer.apple.com/download/more/
- search for Xcode (or latest version e.g Xcode 10.2) and manually download and install it.
See also this post here: https://discussions.apple.com/thread/8622103?answerId=250008933022#250008933022
Check the "purgeable" space of your APFS disk with Disk Utilities..It seems Finder count this space in free space, but not App Store..
But you can trick macOS to clean up APFS by creating a huge garbage file, then deleting it.
To create the file I used the command:
dd if=/dev/zero of=/Users/<username>/hugefile bs=100m
letting dd run for about 30 seconds, then killing it with ctrl+c, and deleting the file:
rm ~/hugefile
Then App Store happily installed update..
Open finder: in menu above go to -> Go to folder:
~/Library/Developer/Xcode/
Delete old simulator files on:
~/Library/Developer/Xcode/iOS DeviceSupport/
Delete all files derived data on:
~/Library/Developer/Xcode/DerivedData
An easy way to accomplish these is by using DevCleaner for Xcode: https://apps.apple.com/us/app/devcleaner/id1388020431?mt=12