CocoaPods缓存清理
~/Library/Caches/Cocoapods/
随着每次的`pod install`或者`pod update`,pod的缓存文件会慢慢增多,这些文件会保存在`~/Library/Caches/Cocoapods/`目录下
// shell command
pod cache clean --all
模拟器文件(runtimes)清理
// 是系统级别的资源库, 非用户级别资源库, `~/Library/Developer/CoreSimulator`中没有`Profiles`文件夹
/Library/Developer/CoreSimulator/Profiles/Runtimes
在 Xcode -> Preferences -> Components 中下载的 Simulators 文件
// 删除 Runtimes 文件夹下所有的模拟器文件
sudo rm -rf /Library/Developer/CoreSimulator/Profiles/Runtimes/*
Xcode编译缓存目录
~/Library/Developer/Xcode/DerivedData
1. Xcode存储各种中间构建结果、生成索引等的位置。你可以在 Xcode 的 preferences 中设置`Derived Data`的位置;
2. DerivedData文件夹也因为其占用内存空间太大而臭名昭著;
3. 清理之后构建首次构建项目的时候可能会增加构建时间;
rm -rf ~/Library/Developer/Xcode/DerivedData/*
// 对于经常开发iOS的同学,可以为该命令创建一个类型别名
alias xcode-clean-derived="rm -rf ~/Library/Developer/Xcode/DerivedData/*"
Others
如果还想要进一步清理磁盘空间, 可以将`~/Library/Caches/`文件夹中的所有缓存文件全部删除