Skip to content

Instantly share code, notes, and snippets.

@madson
Created March 17, 2014 22:54
Show Gist options
  • Save madson/9610073 to your computer and use it in GitHub Desktop.
Save madson/9610073 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