Search code examples
ioscachingtestingdiskspace

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


There are a number of test machines on our CI farm. I've noticed the Mac machines have started to run out of disk space. This is caused by the directory /Library/Caches/com.apple.dt.instruments.

Obviously the tests are causing this growth. Is it possible for me to redirect them to create the cache in our Jenkins workspace? i.e. So the cache will be deleted between runs.


Solution

  • Since there doesn't appear to be any reliable way to do this, I suggest a scheduled script that cleans it up. For example, to clean up old subfolders that haven't been accessed in 30 days:

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