Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Swift 3 from command line using Xcode 8 Beta

Can I run Swift 3 from the command line after installing the Xcode 8 beta? I see that /usr/bin/swift is still the May 5th Swift 2.2. I was hoping to see something like /usr/bin/swift3 but no such luck.

swift.org downloads says that "Swift 3.0 Preview 1 is available as part of Xcode 8.0 beta." But I haven't found instructions on running a command line Swift 3 using the Xcode 8 beta.

Ideally, I would like to use the interactive REPL ... as well as do command-line compilation of Swift Package Manager code.

like image 878
Rick Majpruz Avatar asked Jun 26 '16 11:06

Rick Majpruz


2 Answers

sudo xcode-select -s /Applications/Xcode-beta.app 
swift
like image 64
Maciek Czarnik Avatar answered Oct 14 '22 16:10

Maciek Czarnik


Run Xcode-Beta and change Command line tools

enter image description here

Profit:

enter image description here

like image 33
Arsen Avatar answered Oct 14 '22 16:10

Arsen