Skip to content

Instantly share code, notes, and snippets.

@npu3pak
Last active November 12, 2018 11:58
Show Gist options
  • Save npu3pak/77587c4d52bd3f4a145441f487e5912b to your computer and use it in GitHub Desktop.
Save npu3pak/77587c4d52bd3f4a145441f487e5912b to your computer and use it in GitHub Desktop.
Script creates 4Gb RAM disk and uses it for DerivedData
#!/bin/bash
readonly disk_path="$(hdid -nomount ram://7800000)"
readonly disk_number="$(echo $disk_path | sed 's|/dev/disk||g')"
echo $disk_number
newfs_hfs -v "DerivedData" "/dev/rdisk$disk_number"
diskutil mount -mountPoint ~/Library/Developer/Xcode/DerivedData "/dev/disk$disk_number"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment