> ## Content Index
> Fetch the complete content index at: https://www.justinw.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# Picking your Swift toolchain from xcodebuild
- URL: https://www.justinw.me/blog/picking-your-swift-toolchain-from-xcodebuild/
- Published: 2016-06-17T09:11:59.000Z
- Updated: 2016-06-24T11:27:25.000Z
- Author: Justin Williams
- Tags: swift

With Xcode 8 `xcodebuild` uses Swift 3 to build by default. This will be great in about six months, but right now it’s somewhat of a pain. I am using Carthage as my dependency manager and all of those are using Swift 2.x still.

If you want to build your Carthage dependencies (or anything from the command line for that matter) using Swift 2.3, add the `TOOLCHAINS` parameter.

```
TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage build

```

**Update:** As of Carthage [0.17](https://github.com/Carthage/Carthage/releases/tag/0.17?ref=justinw.me) you can use a `--toolchain` option. This doesn’t help with raw `xcodebuild` obviously.