layout | title | permalink |
---|---|---|
page |
Install Swift |
/install-swift/ |
You have the choice between:
- macOS and Ubuntu (14.04, 15.10 or 16.04)
- on macOS between using Xcode or some plain editor (Emacs, vi, TextMate, etc)
If you have a Mac, the easiest is plain Xcode 8 with Swift 3.0.
Due to a bug in the Linux Swift 3.0.0 release you need to use Swift 3.0.1 or later on Linux.
Already have Xcode 8 installed? Make sure it is up to date. Need Xcode? Available for free at developer.apple.com.
Once you got it, head over to Download Noze.io.
A manual tarball install of Swift is just fine, but swiftenv seems to be useful. Swiftenv installation steps:
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bash_profile
echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(swiftenv init -)"' >> ~/.bash_profile
sudo apt-get install -y \
libcurl4-openssl-dev \
clang make git libicu52 \
autoconf libtool pkg-config \
libblocksruntime-dev \
libkqueue-dev \
libpthread-workqueue-dev \
systemtap-sdt-dev \
libbsd-dev libbsd0 libbsd0-dbg
swiftenv install https://swift.org/builds/swift-3.0.1-release/ubuntu1404/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu14.04.tar.gz
swiftenv install https://swift.org/builds/swift-3.0.1-release/ubuntu1510/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu15.10.tar.gz
swiftenv install https://swift.org/builds/swift-3.0.1-release/ubuntu1604/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu16.04.tar.gz
Install Xcode 8, available for free at developer.apple.com.
Make sure it works, if the thing below doesn't, Noze.io won't work either:
swift
import Dispatch
let Q = DispatchQueue.global()
Q.async { print("Hello!"); }
import Glibc
sleep(5)
Doesn't work? Ask for help on Slack or mailinglist! It does work? Head on to Download Noze.io