To build/install from sources do the following:
- Install dependencies
- Create codesign certificate in
Keychain Access.app - Run one of the entry point scripts to build/install from sources
If you struggle to build AeroSpace locally, you can also refer to builds in GitHub Actions
SPM. Swift package manager and Swift build tool. In other words, swift CLI tool
- Install Xcode from App Store https://apps.apple.com/us/app/xcode/id497799835
- Install swiftly.
Swiftly is a Swift toolchain manager that will make sure that you use the same swift version as written in
.swift-versionfile.brew install swiftly - If you want to build shell completion, install rust, bash and fish
- Install Rust using rustup. https://www.rust-lang.org/tools/install
brew install bash fish
- If you want to build man pages, install Ruby >= 3.0. I recommend using rbenv.
rbenv install 3.3.4(or whatever 3.x version)- Install asciidoctor using Ruby
bundler.cd AeroSpace && bundler install
- Install optional
xcbeautifyto make Xcode build logs readable.brew install xcbeautify
If you want to run AeroSpace as App Bundle (AeroSpace.app) you need to create self-signed certificate that will be used to codesign AeroSpace. Release artifact is built as App Bundle. If you only plan to build the debug version of AeroSpace, you can run it from the terminal and custom certificate is not required.
- Open
Keychain Access.app - Menu ->
Keychain Access->Certificate Assistance->Create a Certificate...- Name:
aerospace-codesign-certificate - Identity Type:
Self-Signed Root - Certificate Type:
Code Signing
- Name:
Debug build
build-debug.sh- Build debug build to.debugdir by using SPM. (Xcode is not involved)run-tests.sh- Run tests.swiftformat.sh- Format the code.run-debug.sh- Run AeroSpace.app debug build.run-cli.sh- Runaerospacein CLI. Arguments are forwarded toaerospacebinary.build-docs.sh- Build the site and man pages to.siteand.mandirs respectively.build-shell-completion.sh- Build shell completion to.shell-completion. You can test that the completion works properly by sourcing the filesource ./.shell-completion/zsh/_aerospacegenerate.sh- Regenerate generated project files.AeroSpace.xcodeprojis generated, and some of the source files (the source files haveGeneratedsuffix in their names).
Release build
build-release.sh- Build release build to.releasedir by using Xcode.install-from-sources.sh- Build release build from sources and install it asaerospace-devbrew cask. This script is "work in progress". Use it on your own risk.
- You can obviously open the project in Xcode.
- You can use your editor of choice (Neovim, Vim, Emacs, Sublime, VS Code) by using sourcekit-lsp LSP. I only tested it in Neovim
- AppCode. The initial codebase was written in AppCode and the IDE was pretty solid. But AppCode was unfortunately sunsetted, and it started falling apart. Last time I checked it, it didn't support Swift 5.9 features, and I couldn't make it reliably import the project. RIP
Even if you use LSP and another text editor, Xcode is still useful to attach debugger (though you can use lldb in CLI).
- To open the project in Xcode: File -> Open -> Choose
Package.swiftfile instead ofAeroSpace.xcodeproj. It's better to openPackage.swift, because SPM project is more lightweight.AeroSpace.xcodeprojis only used in*release*.shbuild scripts. - After you opened the project in Xcode.
Edit Scheme... -> Options -> Console -> Choose
Terminal. This way Accessibility permission will be requested from Terminal. If you don't change Console toTerminal, Accessibility permission will be requested on every rebuild, because the debug binary is unsigned.
- Use built-in "Accessibility Inspector.app" to inspect accessibility properties of windows
- Use DeskPad or BetterDisplay 2 to emulate several monitors
- You can use
script/clean-project.shto clean the project when something goes wrong.