Last active
July 18, 2024 16:28
-
-
Save siliconsocket/80eb472189e141dc6b5e5bb3f9cc074d to your computer and use it in GitHub Desktop.
Script to create a RAM disk (12 GB) to mount Xcode's derivedData for faster buildings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gigabytes=12 | |
| capacity=$(($gigabytes * 2097152)) | |
| ramdisk=$(hdid -nomount ram://$capacity) | |
| newfs_hfs -v DerivedData $ramdisk | |
| diskutil mount -mountPoint ~/Library/Developer/Xcode/DerivedData $ramdisk |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sh ramdisk.shto run it (inside directory that you saved it)CAUTION: RAMdisk will be filled with derived data from your App's builds, so you need to destroy RAMdisk periodically if you receive a compilation error (close Xcode, then unmount RAMdisk from your desktop with right-click, then re-run this script and re-open Xcode Again).
Tested on Mac OS Big Sur