Slim your OS X CI virtual machines
If you're building VMs for CI with packer you can usually safely remove many extras. The desktop wallpapers and screensavers account for 440MiB and 140MiB on their own in El Capitan:
#!/bin/bash
# Removes unneeded files from OS X, saves 2-3 GB disk space.
set -ex
echo "Removing unused directories..."
directories=(
"/System/Library/Speech/Voices/"
"/Library/Dictionaries"
"/Library/Desktop Pictures/"
"/Library/Screen Savers/"
"/Library/Fonts"
)
for i in "${directories[@]}"
do
rm -rf "$i"
done
echo "Removing recovery disk..."
diskutil list
# Erase recovery disk
diskutil eraseVolume Free Space /dev/disk1s3
# Expand main volume to max size, to actually use the extra free space
diskutil resizeVolume /dev/disk1s2 R
Written by Blake Mesdag
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#