Xcode 6.0でswift/swiftcを起動する
Never run this procedure on Mountain Lion or former, or you will have unexpected behavior.
Mountain Lion以下では絶対に実行しないでください。
In short, you can just copy everything.
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
sudo mkdir MacOSX10.10.sdk
cd MacOSX10.10.sdk
sudo cp ../MacOSX10.9.sdk/SDKSettings.plist ./
sudo sed -i -e 's/10\.9/10.10/' SDKSettings.plist
sudo ln -s ../MacOSX10.9.sdk/System
sudo ln -s ../MacOSX10.9.sdk/usr
And you are all set. Just execute xcrun -sdk macosx10.10 swift program.swift
! Have fun!
(You should remove this before updating to upcoming 6.1)
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
sudo rm MacOSX10.10.sdk/*
sudo rmdir MacOSX10.10.sdk
Broken SDK path?
If xcrun -sdk macosx10.9 --show-sdk-path
is pointed to MacOSX10.10.sdk for some reasons (like <unknown>:0: warning: no such SDK: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
), executing xcrun --no-cache -sdk macosx10.9 --show-sdk-path
will fix the issue.
SDKのパスが異常な値になった場合は、xcrun --no-cache -sdk macosx10.9 --show-sdk-path
によって復旧することができます。