Install Swift for macOS

Download and install the latest version of Xcode from the App Store.

To verify your Swift installation, open a Terminal, enter the ‘swift’ command and pass the ‘--version’ flag:

swift --version

You should see something similar like this:

Apple Swift version x.x.x (LLVM ..., Clang ..., Swift ...)

If you see an error message, such as ‘swift: command not found’, you will need to install the Xcode Command Line Tools. Within the Terminal type:

xcode-select --install

Alternatively you can install Command Line Tools within Xcode:

  1. Open Xcode Preferences using the shortcut: ⌘ + ,
  2. Click on the Locations tab.
  3. From the Command Line Tools drop down menu ensure the latest version of Xcode is selected.

Next steps

Hello World: Create a simple "Hello World" Kitura server.

Create a Server: Create a Kitura server with scaffolding for a full application.

Back to top