Useful commands

The list of commands for this is not that broad like other dependency managers. An important command is as follows:

swift build

It automatically downloads all dependencies defined in the manifest file. Then, they are compiled and linked to the current module, but to use it, you need a working manifest file—Package.swift.

If you want to develop an executable Terminal project  from scratch, then you have to use the following command:

swift package init --type executable

We can use --type library if we want to develop a Swift library and get the following output:

The following command will generate an empty executable project ...

Get Learn Swift by Building Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.