swift
Swift language compiler and package manager
TLDR
Start REPL
SYNOPSIS
swift [build] [run] [test] [package] [options] [files]
DESCRIPTION
swift is the Swift programming language compiler and package manager. It builds, runs, and tests Swift applications.
The REPL provides interactive Swift execution. It's useful for experimentation and learning.
Swift Package Manager handles dependencies and builds. Package.swift defines targets, dependencies, and products.
Debug builds are fast to compile with debugging support. Release builds optimize for performance.
Testing integrates XCTest framework. Tests run with swift test, supporting parallel execution.
Cross-platform support includes Linux and Windows beyond Apple platforms. Server-side Swift is a common use case.
PARAMETERS
build
Build the package.run [TARGET]
Build and run.test
Run tests.package init
Create new package.package update
Update dependencies.package resolve
Resolve dependencies.-c CONFIG
Build configuration (debug, release).-Xswiftc FLAG
Pass flag to compiler.--version
Show version.--help
Show help.
CAVEATS
Full functionality on macOS. Linux support is good but some Apple frameworks unavailable. Windows support is newer.
HISTORY
Swift was announced by Apple at WWDC 2014, developed by Chris Lattner and others. It was open-sourced in 2015. Swift has evolved significantly, with Swift 6 introducing strict concurrency.
SEE ALSO
swiftc(1), xcodebuild(1), vapor(1)
