virtualswift — Virtual environments for swift

Ankit
2 min readNov 21, 2017

--

virtualswift is a tool that allows you to create local swift environments on both Ubuntu and MacOS. It is basically a shell script that creates a new directory and installs swift inside it. Then, it updates the PATH variable to use the local version of swift.

If you are familiar with python, it’s the equivalent of virtualenv but for swift.

How is it useful?

virtualswift can help you in isolating different swift project. It also makes it easier to use different versions of swift on the same machine.

Swift versions currently supported are: 4.0.2, 4.0, 3.1.1, 3.1.

Creating and running environments for different swift versions using virtualswift is trivial on Ubuntu. For MacOS, you need to select the correct version of xcode depending on the version of swift you are activating. You can read about xcode select here. The following table shows the version of xcode required for each version of swift.

It’s super convenient if you are using Ubuntu for both development and production because you can simply copy your local swift environments to the server, activate them and run them.

For installation and usage instructions, please checkout the github repo.

If you find virtualswift useful, Clap your 👏. Feel free to share your suggestions/feedback with me on Twitter.

--

--