|
1 | 1 | --- |
2 | 2 | layout: page |
3 | | -title: Getting Started with Swiftly |
| 3 | +title: Getting Started with Swiftly on macOS |
4 | 4 | --- |
5 | 5 |
|
6 | | -Download swiftly from the [install page](/install). |
7 | | - |
8 | | -Run the following command in your terminal, to configure swiftly for your account: |
9 | | - |
| 6 | +On macOS you can run download the pkg: |
10 | 7 | ``` |
11 | | -$ swiftly init |
| 8 | +curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg |
12 | 9 | ``` |
13 | 10 |
|
14 | | -Once swiftly is installed you can use it to install the latest available swift toolchain like this: |
| 11 | +Run the pkg installer from the command-line like this: |
| 12 | +``` |
| 13 | +installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory |
| 14 | +``` |
15 | 15 |
|
| 16 | +Now run swiftly init to finish the installation: |
| 17 | +``` |
| 18 | +/usr/local/bin/swiftly init |
16 | 19 | ``` |
17 | | -$ swiftly install latest |
| 20 | +Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift. |
| 21 | +``` |
| 22 | +$ swift --version |
18 | 23 |
|
19 | | -Fetching the latest stable Swift release... |
20 | | -Installing Swift 6.0.1 |
21 | | -Downloaded 1355.3 MiB of 1355.3 MiB |
22 | | -Installing package in user home directory... |
23 | | -installer: Package name is Swift Open Source Xcode Toolchain |
24 | | -installer: Upgrading at base path /Users/swift |
25 | | -installer: The upgrade was successful. |
26 | | -Swift 6.0.1 installed successfully! |
27 | 24 |
|
28 | | -$ swift --version |
| 25 | +Swift version 6.0.3 (swift-6.0.3-RELEASE) |
| 26 | +... |
29 | 27 |
|
30 | | -Apple Swift version 6.0.1 (swift-6.0.1-RELEASE) |
31 | | -Target: arm64-apple-macosx15.0 |
32 | | -``` |
33 | 28 |
|
34 | | -Or, you can install (and use) a swift release: |
| 29 | +$ swift build # Build with the latest (6.0.3) toolchain |
| 30 | +``` |
35 | 31 |
|
| 32 | +You can install (and use) another release toolchain: |
36 | 33 | ``` |
37 | 34 | $ swiftly install --use 5.10 |
38 | 35 |
|
| 36 | +
|
39 | 37 | $ swift --version |
40 | 38 |
|
41 | | -Apple Swift version 5.10 (swift-5.10-RELEASE) |
42 | | -Target: arm64-apple-macosx15.0 |
43 | | -``` |
44 | 39 |
|
45 | | -There's also an option to install the latest snapshot release and get access to the latest features: |
| 40 | +Swift version 5.10.1 (swift-5.10.1-RELEASE) |
| 41 | +... |
46 | 42 |
|
| 43 | +
|
| 44 | +$ swift build # Build with the 5.10.1 toolchain |
| 45 | +``` |
| 46 | + |
| 47 | +Quickly test your package with the latest nightly snapshot to prepare for the next release: |
47 | 48 | ``` |
48 | 49 | $ swiftly install main-snapshot |
| 50 | +$ swiftly run swift test +main-snapshot # Run "swift test" with the main-snapshot toolchain |
| 51 | +$ swift build # Continue to build with my usual toolchain |
| 52 | +``` |
| 53 | + |
| 54 | +Uninstall this toolchain after you’re finished with it: |
| 55 | +``` |
| 56 | +$ swiftly uninstall main-snapshot |
49 | 57 | ``` |
50 | 58 |
|
51 | | -> Note: This last example just installed the toolchain. You can run "swiftly use" to switch to it and other installed toolchahins when you're ready. |
| 59 | +[Learn more about Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs) |
0 commit comments