Skip to main content
This guide covers building AppFlowy for desktop platforms (macOS, Windows, and Linux) from source.

Prerequisites

Before building, ensure you have completed the development environment setup.
All commands should be run from the frontend/ directory.

Quick Start

1

Navigate to frontend

2

Build for your platform

3

Run Flutter app

Build Profiles

AppFlowy uses cargo-make with different build profiles:

Building the Rust Backend

Development Build

1

Choose architecture

2

Build Rust backend

This command:
  • Compiles the Rust backend as a static library
  • Copies the library to the Flutter app
  • Generates FFI bindings
macOS builds use staticlib (.a) for better integration with the app bundle.

Production Build

Production builds are optimized with LTO and higher optimization levels:

Building the Flutter App

Development Mode

1

Navigate to Flutter directory

2

Install dependencies

3

Generate code

4

Run the app

Release Build

The app will be at:

Build Configuration

Makefile.toml

The build process is configured in frontend/Makefile.toml:

Environment Variables

Key environment variables:

Platform-Specific Details

macOS Build Details

Crate Type: Static library (.a)Build Targets:
  • aarch64-apple-darwin (Apple Silicon)
  • x86_64-apple-darwin (Intel)
Universal Binary:To create a universal binary that runs on both architectures:
Code Signing:For distribution, you’ll need to sign the app:

Clean Build

To clean all build artifacts:

Troubleshooting

Common build issues and solutions:

Rust Build Fails

Flutter Build Fails

Library Not Found

Protobuf Errors

Performance Optimization

Build Times

To improve build times:
1

Use incremental compilation

2

Use cargo cache

3

Parallel jobs

Release Optimization

The production profile uses:

Next Steps

Building Mobile

Build AppFlowy for iOS and Android

Testing

Learn how to run tests

Contributing

Contribute your changes

Code Style

Follow coding conventions