Swift Command Line Application Template
The regular Command Line Tool template that comes with Xcode doesn't support Swift Frameworks. Swift Applications need a copy of the Swift Standard Libraries in their run path. The regular Cocoa Application template that comes with Xcode copies the Swift Standard Libraries to the app's bundle, but it also comes with storyboards and a lot of stuff that command line applications don't need.
The Swift Command Line Application template provides only what's needed to run a Swift Application using Swift Frameworks.
- Supports Swift Frameworks
- Script that extracts the executable, swift standard libraries and frameworks from the app's bundle.
- Open Xcode and press ⇧⌘9 or go to
Swif Command Line Application
- Type your
Product Name, etc.
- Select directory and press
main.swiftwill be entry point of your app
- To add Swift Frameworks select the project, app target, and on the
- Select your frameworks
- That's it (:
Alcatraz is an open-source package manager for Xcode 5+. It lets you discover and install plugins, templates and color schemes without the need for manually cloning or copying files. It installs itself as a part of Xcode and it feels like home.
Install Alcatraz by running:
curl -fsSL https://raw.github.com/alcatraz/Alcatraz/master/Scripts/install.sh | sh
- With Xcode open press ⇧⌘9 or go to
Package Managerto open Alcatraz.
- Look for Swift Command Line Application under Templates.
- Click on the
- Restart Xcode.
- Clone or download the repo.
- Copy the
Project Templatesdirectory to
- If the
~/Library/Developer/Xcode/Templates/Project Templatesdirectory already exists, copy the
Zewodirectory to it
- Restart Xcode.
Join us on Slack.
Swift Command Line Application Template is released under the MIT license. See LICENSE for details.