LoginSignup
6
6

More than 5 years have passed since last update.

Running swift/swiftc on Xcode 6.0

Last updated at Posted at 2014-10-09

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.

setup_macosx10_10.sh
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)

remove_macosx10_10.sh
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によって復旧することができます。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6