Skip to content

Instantly share code, notes, and snippets.

@afaur
Created January 13, 2017 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afaur/c83c075f3edbf2a4f9f85721902a8d0d to your computer and use it in GitHub Desktop.
Save afaur/c83c075f3edbf2a4f9f85721902a8d0d to your computer and use it in GitHub Desktop.
Installing older .h files that are no longer in the latest Mac OSX SDK
# Go the temp directory on your machine
cd /tmp
# Download the 10.11 sdk from apple
wget http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.11_for_Xcode_8.2/Command_Line_Tools_macOS_10.11_for_Xcode_8.2.dmg
# (If you don't have wget copy the dmg to the `/tmp` folder)
# Mount the dmg
hdiutil attach Command_Line_Tools_macOS_10.11_for_Xcode_8.2.dmg
# Copy the `.pkg` from the mounted dmg files volume
cp "/Volumes/Command Line Developer Tools/Command Line Tools (macOS El Capitan version 10.11).pkg" /tmp/CLDT.pkg
# Safely detach from the dmg volume
hdiutil detach "/Volumes/Command Line Developer Tools"
# Still inside `/tmp` folder you should now have a file called `CLDT.pkg`
ls
# Extract the contents of the `.pkg` into a folder called `CLDT`
pkgutil --expand "CLDT.pkg" "/tmp/CLDT"
# Enter into the `CLDT` directory
cd CLDT
# Browse to the inside of the correct sub package
cd DevSDK_OSX1011.pkg
# Need `pbzx` for next step, get it here:
# - https://github.com/afaur/pbzx
# - follow instructions to compile and put the binary on your path
# Use `pbzx` to extract the Payload from this package
# (this extracts the contents inside the current folder instead of installing them)
pbzx -n Payload | cpio -i &> /dev/null
# Make folders for `QTKit` and `QuickTime` in your `include` folder
sudo mkdir /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/QTKit
sudo mkdir /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/QuickTime
# Copy the correct `.h` files to the correct folders you created
sudo cp -R \
System/Library/Frameworks/QTKit.framework/Versions/A/Headers/ \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/QTKit
sudo cp -R \
System/Library/Frameworks/QuickTime.framework/Versions/A/Headers/ \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/QuickTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment