Skip to content

Instantly share code, notes, and snippets.

View kelan's full-sized avatar

Kelan Champagne kelan

View GitHub Profile

Values of macros from TargetConditionals.h.

Xcode 7 / iOS 9.1, tvOS 9.0, watchOS 2.0, OS X 10.11 SDKs

Macro 🖥 📱 📱sim ⌚️ ⌚️sim 📺 📺sim
TARGET_OS_MAC 1 1 1 1 1 1 1
TARGET_OS_IPHONE 0 1 1 1 1 1 1
TARGET_OS_IOS 0 1 1 0 0 0 0
TARGET_OS_WATCH 0 0 0 1 1 0 0
@pilky
pilky / ShowDerivedData.rb
Created November 5, 2011 14:24
A script for showing the derived data folder for an Xcode workspace. Intended to be invoked from a custom behaviour
#!/usr/bin/env ruby
#This script currently only works if you have your derived data in the default location
#First look for a project path as our workspace
xcodeWorkspacePath = ENV['XcodeProjectPath']
if xcodeWorkspacePath
workspaceName = /([\w\s]+).xcodeproj/.match(xcodeWorkspacePath)[1]
#If we don't have a project we have a workspace, check for that and exit with code 1 if that doesn't exist
else
@tlrobinson
tlrobinson / gist:1073865
Created July 9, 2011 19:34
Autocomplete Makefile targets. Add this to your shell config file.
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make