All Projects → ikiapps → Setup-Xcode-Derived-Data-RAM-Disk

ikiapps / Setup-Xcode-Derived-Data-RAM-Disk

Licence: other
Swift Script: Get the fastest build times in Xcode. This repository accompanies my article linked here:

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Setup-Xcode-Derived-Data-RAM-Disk

JSONPreview
🎨 A view that previews JSON in highlighted form, it also provides the ability to format and collapse nodes.
Stars: ✭ 21 (-82.2%)
Mutual labels:  swift5
ax-editor
Ax is a code editor with syntax highlighting that runs in your terminal written completely in Swift.
Stars: ✭ 42 (-64.41%)
Mutual labels:  swift5
Shift
Light-weight EventKit wrapper.
Stars: ✭ 31 (-73.73%)
Mutual labels:  swift5
SwiftyPing
ICMP ping client for Swift 5
Stars: ✭ 129 (+9.32%)
Mutual labels:  swift5
SwiftStudy
Swift学习之微博朋友圈列表功能实现
Stars: ✭ 63 (-46.61%)
Mutual labels:  swift5
SwiftUI-Currency-Converter
Currency Converter project coded by SwiftUI and Swift5
Stars: ✭ 56 (-52.54%)
Mutual labels:  swift5
Combinative
UI event handling using Apple's combine framework.
Stars: ✭ 106 (-10.17%)
Mutual labels:  swift5
OnlySwitch
⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
Stars: ✭ 1,288 (+991.53%)
Mutual labels:  swift5
HummingKit
Ease the Use of Apple Music API in Swift 5.
Stars: ✭ 19 (-83.9%)
Mutual labels:  swift5
InstantMock
Create mocks easily in Swift
Stars: ✭ 88 (-25.42%)
Mutual labels:  swift5
Shell
Module exposing Unix command line tools as Swift 5 @dynamicCallable functions
Stars: ✭ 104 (-11.86%)
Mutual labels:  swift5
ios ui recipe showcase
iOSアプリ開発 - UI実装であると嬉しいレシピブック掲載サンプル
Stars: ✭ 54 (-54.24%)
Mutual labels:  swift5
SSAppUpdater
SSAppUpdater is an open-source framework that compares the current version of the app with the store version and returns the essential details of it like app URL, new app version number, new release note, etc. So you can either redirect or notify the user to update their app.
Stars: ✭ 58 (-50.85%)
Mutual labels:  swift5
m3u8ToMP4
iOS demo,avplayer play m3u8 .ts file
Stars: ✭ 22 (-81.36%)
Mutual labels:  swift5
Swift101
That contains various information and examples about the basics of Swift Programming. 💻 📱 📺 ⌚️
Stars: ✭ 28 (-76.27%)
Mutual labels:  swift5
SwiftQRCodeScanner
An easy QR code reader for iOS written in Swift
Stars: ✭ 49 (-58.47%)
Mutual labels:  swift5
aprenda-swift
Uma lista de conteúdos para você aprender Swift
Stars: ✭ 429 (+263.56%)
Mutual labels:  swift5
SwiftUI-Tooltip
Easy Tooltip for your SwiftUI Project
Stars: ✭ 130 (+10.17%)
Mutual labels:  swift5
MIDIKit
🎹 Modern multi-platform Swift CoreMIDI wrapper with MIDI 2.0 support.
Stars: ✭ 26 (-77.97%)
Mutual labels:  swift5
SwiftGradients
Useful extensions for UIViews and CALayer classes to add beautiful color gradients.
Stars: ✭ 15 (-87.29%)
Mutual labels:  swift5

Get the Fastest Build Times in Xcode

Instead of having Xcode’s Derived Data based in a spinning disk or solid-state drive, move it to a RAM disk. Then, the performance of Xcode build operations run as fast as possible. A side benefit is the contents do not persist across reboots and, therefore, do not accumulate excessively.

I have crafted a script in Swift to perform the necessary configuration for you. It can automatically start using a launch agent at startup, so the RAM disk is always available. Returning to a standard Xcode configuration requires ejecting the RAM disk.

It works because the RAM disk mounts to the default path for the DerivedData folder that Xcode uses. You can verify this path in Xcode under Locations in Preferences. The RAM disk gets used by command-line builds and is thereby compatible with alternative IDEs such as AppCode.

Installation

Define the install path in the build settings under INSTALL_DIR. The binary product is copied to this location when building the project. A default path of $(HOME)/bin is set. Configuration of this value is by two settings in Xcode's build settings: INSTALL_ROOT and INSTALL_PATH.

Complete the following steps to build and install the compiled version of the script.

  • If needed, change the size of RAMDISK_GB in main.swift
  • If needed, change the install path under Targets > SetupXcodeDerivedDataRamDisk > Build Settings > Installation Build Products Location + Installation Directory
  • Build the project in Xcode

Alternative installation

Copy main.swift to a local path of your choosing, such as

~/bin/setupXcodeDerivedDataRAMDisk.swift

Make it executable with

chmod +x ~/bin/setupXcodeDerivedDataRAMDisk.swift

Run at startup

Create a file with the following content. Edit it to fit your system. Replace ${INSERT_YOUR_USERNAME} with your username. Add .swift to the filename if using the text-based script.

<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
<dict>
<key>Label</key>
<string>com.ikiApps.setupXcodeDerivedDataRamDisk.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/xcrun</string>
<string>/Users/${INSERT_YOUR_USERNAME}/bin/setupXcodeDerivedDataRAMDisk</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>

Give it a name, for example, com.ikiApps.setupXcodeDerivedDataRamDisk.plist, and copy it to

~/Library/LaunchAgents

User readable is the minimum permission for the property list. That corresponds to a permission value of 0400 for chmod.

Make sure Xcode is not running, and manually test starting the agent with the following command:

launchctl load com.ikiApps.setupXcodeDerivedDataRamDisk.plist

If everything went well, the script should now run every time you log in. You can see the mounted RAM disk in the Finder when it is available. It will also be available in the list of mounts using the mount or df command.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].