• Stars
    star
    104
  • Rank 329,318 (Top 7 %)
  • Language
    Shell
  • Created almost 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small script to launch Xcode using a RAM disk

xc-launch

      ____________________________
     /                           /\           β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—
    /                          _/ /\          β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘
   /        xc-launch          / \/            β•šβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
  /                           /\               β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘
 /___________________________/ /              β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘
 \___________________________\/               β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β•  β•šβ•β•
  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \               ... your derived data folder in RAM


This is a small script to launch Xcode using a RAM disk to store intermediate build products files, normally found in DerivedData.

Motivation

After some time using Xcode, the DerivedData folder tends to grow. In my secondary development machine takes now 1.8 GB. Creating all these files in a RAM Disk destroys everything after switching off your machine (or ejecting the drive). Also, if you have enough memory, it speeds up compiling (everything happens in RAM)

This problem is shown here: https://twitter.com/mindbrix/status/412929707727159296

Also, in this StackOverflow discussion

Installation

  1. Just copy this script somewhere in your PATH, for instance to /usr/local/bin (using for example cp xc-launch.sh /usr/local/bin)
  2. Grant it executable permissions: chmod a+x xc-launch.sh

To make use of it, you need to change your Xcode preferences

  1. Go to Xcode > Preferences > Locations
  2. Point Derived Data to /Volumes/ramdisk

You don't need to be root to run this :-)

When you finish, eject your ramdisk using the Finder.

Works in

  • macOS 10.9 - 10.12 - OK
  • Xcode 6, 7, 8

Others: let me know, should work

Will this thing make compilation faster?

I haven't timed it. Maybe using time and xcodebuild from command line with the same project, on average would be a good way to measure it.

But I use this script mainly because everything gets created in memory:

  • less stress put on my SSD
  • no GB lost somewhere else in my HD

How do you launch this?

Personally I use the terrific DTerm, with a shortcut of Cmd + Alt + Ctrl + T (for Terminal), then use autocomplete to launch xc-launch.sh

Licenses

Distributed under the MIT & Anyone but Richard Stallman licenses ;-)

MIT - Licence

Copyright (c) 2013 Diego Freniche

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

ocp-java8-notes

Some notes about the OCP Java 8 certification
57
star
2

ios-desde-cero

CΓ³digo, documentos y recursos utilizados en el Stream iOS desde cero πŸ“Ί https://www.twitch.tv/dfreniche/
Swift
38
star
3

modern-core-data-playground

An introduction to Core Data you can test, use, change & code, all in just one Playground!
Swift
35
star
4

SwiftANSIColors

A small "library" to print ANSI colored Swift strings to console
Swift
27
star
5

SwiftCLITemplate

A Tuist Template to quickly create CLI apps in Swift
Swift
27
star
6

NSPredicate-Swift

A nice Playground to learn about NSPredicate in Swift
Swift
24
star
7

android-documentation

Several documents that I maintain for myself. Maybe they can help you too.
23
star
8

oca-java8-notes

Some notes about the OCA Java 8 certification
17
star
9

SwiftFiglet

A Swift library to read and display banner like ASCII art messages using Figlet fonts
Swift
15
star
10

SpriteKit-Playground

Sample showing how to run (and show) SpriteKit Nodes inside a Playground
Swift
9
star
11

ios-documentation

Several documents on iOS development I maintain for myself. Maybe they can help you too.
8
star
12

amstradbasic-vscode

A Visual Code extension to colorize AMSTRAD BASIC programs
Visual Basic
6
star
13

TwiOS

Simple iOS Twitter client
Objective-C
6
star
14

Playgrounds

Examples and test code written in Swift
Swift
5
star
15

DFCoreDataStackDemo

Demo of my DFCoreDataStack class, to create a Core Data Stack without the Apple boilerplate code
Objective-C
5
star
16

Everpobre

Everpobre is an Android Evernote-like app to create notes inside notebooks.
Java
4
star
17

mongodbooth

A Project made during Skunkworks Hackathon '22
Swift
4
star
18

WIPReminders

A simple App we hacked in an afternoon @ WIPJam'14
Objective-C
4
star
19

objective-doge

Objective-doge: wow! Such new way to write Objective-C code. Much doge!
Objective-C
3
star
20

sfsymbolspicker

SwiftUI Picker for SF Symbols Font Icons
Swift
3
star
21

fdir

A 4DOS dir inspired tool to list your directories and files with descriptions!
Swift
2
star
22

EnyoMenuDemo

An example of an Enyo (WebOS) app with a fixed menu and several views
JavaScript
2
star
23

crashlet

First-class crash Swift experiences, now system-wide
Swift
2
star
24

SwiftCamera

Simple Swift example on how to use the iPhone Camera
Swift
2
star
25

why-functional-matters

Slides + playground from my talk: "Why functional programming matters?"
Swift
2
star
26

iCPC

ICPC AMSTRAD Emulator for iOS
C
2
star
27

cpctelera_samples_xcode

Xcode integration with the samples from CPCTelera Amstrad cross-compiling toolchain/library
C
2
star
28

physicsdemo

UIKit physics demo
Swift
1
star
29

TwAndroid

A simple Android Twitter client, made with Twitter4j
Java
1
star
30

MarvelAPIHelper

A simple Marvel API wrapper
Objective-C
1
star
31

iOS13ModalHeight

Control the height of a modal view controller with new iOS 13 presentation
Swift
1
star
32

adventure

Text Adventure game
Java
1
star
33

iCaganers

An example on an iOS App, showing a list of items to sell. You can select one item, and then pay with PayPal.
Objective-C
1
star
34

stars

AMSTRAD CPC Demo made using CPC Telera 1.5
Makefile
1
star
35

mongodb-codespaces

Dockerfile
1
star