Skip to content

Instantly share code, notes, and snippets.

@ctreffs
Forked from madson/speedup.sh
Created November 29, 2016 11:56
Show Gist options
  • Save ctreffs/87e1eb5617b3e95d5a2dbc71dd193825 to your computer and use it in GitHub Desktop.
Save ctreffs/87e1eb5617b3e95d5a2dbc71dd193825 to your computer and use it in GitHub Desktop.
Script to mount directories DerivedData and iPhoneSimulator in the RAM
#!/bin/bash
# set disk size for 512 MB
disksize=$((512*(512*4)))
# mounting DerivedData virtual disk
disknum=$(hdid -nomount ram://$disksize | tr -cd '[0-9]')
newfs_hfs -v DerivedData /dev/rdisk$disknum
diskutil mount -mountPoint ~/Library/Developer/Xcode/DerivedData /dev/disk$disknum
# mounting iPhoneSimulator virtual disk
disknum=$(hdid -nomount ram://$disksize | tr -cd '[0-9]')
newfs_hfs -v iPhoneSimulator /dev/rdisk$disknum
diskutil mount -mountPoint ~/Library/Application\ Support/iPhone\ Simulator /dev/disk$disknum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment