Using the open source version of Swift

Swift is already open source version 2.2 The,However, with respect to 2.1 No particular improvement。Swift now supports OS X and Ubuntu,Supported on Ubuntu 14.04 and 15.10 Two versions,You canThis pageDownload the latest version compile(There is no official stable version)Now I will talk about how to use it on both platforms。


Code Signing

On the right side downloaded pkg installation package name should have a small lock,Click on the little lock see detailed content,Electronic signature is Developer ID Installer: Swift Open Source (V9AUD2URP3) ,if not,Then you download pkg may have been tampered with,Download it again:)


For OS X,You can experience directly in the latest Xcode 7.1.1, but in the open source version of Swift--,You still need to download additional expansion packs。

Playground unfortunately can not support this method。For applications submitted to the AppStore,You still need to use Xcode compiler version comes with Swift!

First of all,Run the downloaded installation package PKG,It will give you a Xcode toolchain to install /Library/Developer/Toolchains/

Close completely quit Xcode,Then open the terminal,Use the following command to run Xcode :

It is time to open the Xcode uses the open-source version of the Swift's Xcode。

If you quit Xcode,So next time you run the top command is needed - otherwise the default version comes with Swift。


Download tar archive,Its name should be like: swift-<VERSION>-<PLATFORM> It is the digital signature file。

If this is your first time to download and install,Then you need to install PGP key:

Or download: $ wget -q -O - | gpg --import -

If you previously installed the,Skip。

Signature verification

Use the following command to verify the digital signature Swift:

If you get BAD signature Such a reply,It means you have problems downloading packages,Download it again?

If you get the following message:

Run the following code fixes:


use $ tar xzf swift-<VERSION>-<PLATFORM>.tar.gz Extracting archive。

Swift add to your tool chain environment $ export PATH=/path/to/usr/bin:"${PATH}"

Installation depends $ sudo apt-get install clang Currently swiftc also dependent clang ++。

Such,You can use swift Command to build the project or run the REPL。


At last,good luck:)


Original article written by Gerber drop-off:R0uter's Blog » Using the open source version of Swift

Reproduced Please keep the source and description link:

About the Author


The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published. Required fields are marked *