I\'m using the Mac OS to install the XCode10.1.
I have 18.43GB free disk space in the mac,
but when I click the install button on the Xcode from the app store,<
For Xcode 12 you need to have more than 32GB free space.
Delete the old Xcode application first.
Install OmniDiskSweeper which will show the total space used by the folders, which will be useful to detect the folders which occupy lot of space.
Go to Users -> your_user_name -> Library -> Developer (these are old xcode contents), delete all the contents here, since we are installing new xcode, the old contents are not necessary.
If you have Android Studio and willing to delete it, and install later, then delete the Android Studio application and on OmniDiskSweeper, go to Users -> your_user_name -> Library -> Android (these are old android studio contents), delete all the contents here.
Which will give you lot disk space.