为 com.apple.dt.instruments 设置缓存目录

Set the cache directory for com.apple.dt.instruments

我们的 CI 农场上有许多测试机器。我注意到 Mac 机器已经开始 运行 磁盘 space。这是由目录 /Library/Caches/com.apple.dt.instruments 引起的。

显然是测试导致了这种增长。我可以重定向它们以在我们的 Jenkins workspace 中创建缓存吗?也就是说,缓存将在 运行 秒之间被删除。

由于似乎没有任何可靠的方法来执行此操作,我建议使用计划脚本来清理它。例如,要清理 30 天内未访问过的旧子文件夹:

INSTFLD="/Library/Caches/com.apple.dt.instruments"
find $INSTFLD -type d -atime +30 -mindepth 1 -maxdepth 1 -exec rm -rf {} \;