How to Run a Swift Command Line Tool in Terminal - Swift CLI Build

Опубликовано: 01 Январь 1970
на канале: Paul Solt
818
5

Learn how to use Swift build so that you can create command line tools to simplify your repetitive tasks. Using Swift you can create new executables that you can run directly, just like any other commmand in Terminal.

Commands:

How to run your app:

```
cd .build/debug
./MyCLI --input 'Hello WWDC!'
```

```
cd ./build/release
cp -f MyCLI /usr/local/bin/MyCLI
```

Run (from `/usr/local/bin/MyCLI`)

```
MyCLI
```

Remove/Replace

```
rm -f /usr/local/bin/MyCLI
```

Links:
https://www.swift.org/getting-started...
https://www.swiftbysundell.com/articl...

#swift #cli #executable #command-line #tool #terminal