# Swift Bundler: create macOS apps with SwiftPM instead of Xcodeproj's

**URL:** <https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790>\
**Category:** Community Showcase\
**Created:** [April 18, 2022, 3:01am UTC](https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790 "2022-04-18T03:01:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stackotter](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stackotter/32/20670_2.png) [@stackotter](https://forums.swift.org/u/stackotter)\
**Post date:** [April 18, 2022, 3:01am UTC](https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790/1 "2022-04-18T03:01:34Z")

</div>

Hi all!

I recently released v2.0.0 of [Swift Bundler](https://github.com/stackotter/swift-bundler) — A tool for creating macOS apps with Swift packages instead of Xcodeproj's. This release sports a whole new suite of features such as **package templates** , and a delightful revamped CLI experience.

## Motivation

### Escape Xcode

As Swift support in VSCode & Co improves there is real value in being able to **free our projects from the bounds of Xcodeproj's**. Many of us know exactly how frustrating it is when syntax highlighting breaks, auto complete stops working or **Xcode crashes and we can't do anything to fix it**. VSCode and many other code editors are open source (along with their extensions) and **the community can easily step up and fix bugs**.

However, if you still want to use Xcode, **Swift Bundler has excellent support for running and building through Xcode**.

### A cross-platform future

In the future I hope to add support for other platforms such as Linux, Windows, iOS, Android and more (contributions welcome 😉). Along with an easy to use cross-platform UI framework (such as my WIP [SwiftCrossUI](https://github.com/stackotter/swift-cross-ui)) I believe that Swift could be a great language for developing **performant and native cross-platform apps**.

### Easy to use with CI

Xcodeproj's can be a bit cumbersome to use with CI solutions such as GitHub Actions in my experience (with code signing and all). In contrast, Swift Bundler is extremely easy to use:

```yaml
jobs:
  build:
    runs-on: macos-latest
    steps:
      # ...
      - run: |
          curl -o swift-bundler -L https://github.com/stackotter/swift-bundler/releases/download/v2.0.2/swift-bundler
          chmod +x ./swift-bundler
      - run: ./swift-bundler bundle -c release -o . -u
      # ...

```

## Contributing

I won't have much time to work on new Swift Bundler features for a few weeks, and I would be very grateful if anyone wants to try their hand at adding support for a new platform, codesigning, sandboxing or any other features you can think of.

## Architecture

When rewriting Swift Bundler I decided to use it as a playground for trying out a more functional style of Swift programming with precise error handling at its core, and I think it would definitely be useful for anyone involved in the precise error handling discussion to take a look and see a real-life example of precise error handling in action in Swift with the currently existing utilities. I think it would help with identifying the current points of friction that prevent most people from using precise error handling in tools and internally within frameworks.

## Example use case

For an example of using Swift Bundler in a large real-world project, see [Delta Client](https://github.com/stackotter/delta-client).

---

<div class="post-metadata">

**Author:** ![dipcse07](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dipcse07/32/23865_2.png) [@dipcse07](https://forums.swift.org/u/dipcse07)\
**Post date:** [June 15, 2022, 4:14am UTC](https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790/2 "2022-06-15T04:14:47Z")

</div>

Hi I would like to learn and help as I am also developing desktop app for Mac OS. Would be happy to get started. 🙂

---

<div class="post-metadata">

**Author:** ![stackotter](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stackotter/32/20670_2.png) [@stackotter](https://forums.swift.org/u/stackotter)\
**Post date:** [June 15, 2022, 4:39am UTC](https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790/3 "2022-06-15T04:39:56Z")

</div>

Thanks for your interest! The [Swift Bundler docs](https://stackotter.github.io/swift-bundler/documentation/swiftbundler/) should help you get started. To try out a basic SwiftUI hello world example, just install Swift Bundler and then run the following commands:

```nohighlight
swift bundler create HelloWorld --template SwiftUI
cd HelloWorld
swift bundler run

```

Currently I am not accepting contributions, as I am working on iOS support (which is sponsor-only at the moment). But I will resume accepting contributions in the future.

---

<div class="post-metadata">

**Author:** ![stackotter](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stackotter/32/20670_2.png) [@stackotter](https://forums.swift.org/u/stackotter)\
**Post date:** [July 9, 2023, 10:26pm UTC](https://forums.swift.org/t/swift-bundler-create-macos-apps-with-swiftpm-instead-of-xcodeprojs/56790/4 "2023-07-09T22:26:54Z")

</div>

Hey, really sorry about the whole sponsor-only thing, it was a bit of an experiment to see if I could support myself to continue working on open source with most of my spare time, but it wasn’t working. I’ve gotten a job since then which means I have less time for open source, but at least I don’t have to try getting sponsors for it. I finally got around to getting rid of the whole sponsor only thing a few weeks ago.

If you’re still interested there’s now also iOS support, and Linux support is in the works. Completely understand if you’ve moved on though
