Thursday, March 28, 2019

Xcode eats up spaces (more than 10 GB)

Once in a while, I got prompted that my disk is running out of spaces. As I'm developing an iOS app using Xcode almost everyday, Xcode can be the culprit.

1). This step alone will claim several Gigabytes of disk space back.

> cd ~/Library/Developer/Xcode/DerivedData
> sudo rm -Rf *
    

2). Remove the oldest directories as many as possible
    
> cd ~/Library/Developer/Xcode/DerivedData/Devices
> ls -lh

total 24
drwxr-xr-x@ 4 vathanakmao  staff   136B Jul 21  2018 010C03D5-989F-4220-879E-023F62601A35
drwxr-xr-x@ 4 vathanakmao  staff   136B Jul 21  2018 05589345-6168-4338-9205-A42BF0C0A30C
drwxr-xr-x@ 5 vathanakmao  staff   170B Nov 27 11:13 0D1069CC-C10F-4D31-BB6E-62AF44C5107E
drwxr-xr-x@ 4 vathanakmao  staff   136B Jun 16  2017 0DF311E9-5E61-47CB-BBEA-6E8FEFC022C9
drwxr-xr-x@ 5 vathanakmao  staff   170B Nov 27 11:13 1115F8DE-BD11-4AD7-AC58-AC217D038CC5
drwxr-xr-x@ 4 vathanakmao  staff   136B Jun 26  2017 13145874-EE01-4E68-AA71-4912D6CF587F
drwxr-xr-x@ 4 vathanakmao  staff   136B Jun 26  2017 154CDEA7-17B5-4352-9603-FE8D6A788F2B
drwxr-xr-x@ 4 vathanakmao  staff   136B Dec 26  2016 15813813-54E7-4D77-8B2B-44B9C9105D73
drwxr-xr-x@ 4 vathanakmao  staff   136B Jul 21  2018 15A9EFFC-8718-4165-B3E9-C72F168511D6
drwxr-xr-x@ 4 vathanakmao  staff   136B Jul 21  2018 233E4A23-6956-4945-A7C8-86E6A7F1C1E5
drwxr-xr-x@ 4 vathanakmao  staff   136B Jun 16  2017 2B44F99E-858D-4AEC-BB3F-B816F27848D9
drwxr-xr-x@ 4 vathanakmao  staff   136B Jun 16  2017 2D27D8AE-26BC-423E-B6D7-7C327D9DA042
drwxr-xr-x@ 4 vathanakmao  staff   136B Jul 21  2018 2F6CEB95-74ED-489E-BBE3-AC8DFF766E79
...
    


References
https://stackoverflow.com/questions/36239242/xcode-7-3-taking-too-much-space

No comments:

Post a Comment