When updating Xcode, it may appear as if you have sufficient disk space, yet you still receive a not enough disk space warning. The most straightforward and effective solution is to free up space by deleting previous Xcode builds and unnecessary simulated devices. This can instantly free up several gigabytes of space.
You can perform the following steps in Finder or Terminal to free up space:
1.Delete previous Xcode builds in the /Library/Developer/Xcode/Archives directory, which stores the historical records of your app development builds.
2.Clear the contents of the /Library/Developer/Xcode/iOS DeviceSupport directory, which stores various simulated models that are supported by the Xcode software. Even if you are not an Apple developer, there may be content in this directory that takes up significant space.
3.If you don’t use Xcode at all, you can delete it altogether for more optimal space usage. After performing these steps, you can free up several gigabytes, or even tens of gigabytes, of space.