Skip to main content
This guide covers building AppFlowy for mobile platforms (iOS and Android) from source.

Prerequisites

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

iOS Setup

1

Install Xcode

Download and install Xcode from the App Store or developer.apple.com.
# Install Command Line Tools
xcode-select --install

# Accept license
sudo xcodebuild -license accept
2

Install CocoaPods

sudo gem install cocoapods
pod --version
3

Install cargo-lipo

For building iOS universal libraries:
cargo install cargo-lipo
4

Add iOS targets

rustup target add aarch64-apple-ios         # iOS devices
rustup target add aarch64-apple-ios-sim     # iOS simulator (M1/M2)
rustup target add x86_64-apple-ios          # iOS simulator (Intel)

Android Setup

1

Install Android Studio

Download from developer.android.com.
2

Install Android SDK

Through Android Studio:
  • SDK Platforms: Android 10+ (API 29+)
  • SDK Tools: NDK, CMake
3

Set environment variables

export ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/<version>
export PATH=$PATH:$ANDROID_HOME/platform-tools
4

Install cargo-ndk

For building Android libraries:
cargo install cargo-ndk
5

Add Android targets

rustup target add aarch64-linux-android     # ARM64 (most devices)
rustup target add armv7-linux-androideabi   # ARMv7 (older devices)

Building for iOS

Development Build

1

Build Rust backend

For iOS device (ARM64):
cargo make --profile development-ios-arm64 appflowy-core-dev-ios
For iOS simulator (Apple Silicon):
cargo make --profile development-ios-arm64-sim appflowy-core-dev-ios
This command:
  • Compiles Rust as a static library (.a)
  • Uses cargo-lipo for iOS targets
  • Copies the library to appflowy_flutter/packages/appflowy_backend/ios/
2

Install Flutter dependencies

cd appflowy_flutter
flutter pub get
cd ios
pod install
3

Run on simulator or device

cd ..
flutter run -d ios
Or open in Xcode:
open ios/Runner.xcworkspace

Production Build

1

Build Rust backend (release)

cargo make --profile production-ios-arm64 appflowy-core-dev-ios
2

Build iOS app

cd appflowy_flutter
flutter build ios --release
3

Archive and distribute

Open in Xcode:
open ios/Runner.xcworkspace
Then:
  1. Product → Archive
  2. Distribute App
  3. Follow App Store Connect workflow
iOS builds use staticlib (.a) format for compatibility with iOS apps.

Building for Android

Development Build

1

Build Rust backend

For ARM64 devices (most common):
cargo make --profile development-android appflowy-core-dev-android
This command:
  • Compiles Rust as a shared library (.so)
  • Uses cargo-ndk to build for Android
  • Copies JNI libs to appflowy_flutter/android/app/src/main/jniLibs/
2

Install Flutter dependencies

cd appflowy_flutter
flutter pub get
3

Run on emulator or device

flutter run -d android

Production Build

1

Build Rust backend (release)

cargo make --profile production-android appflowy-core-dev-android
2

Build Android APK

cd appflowy_flutter
flutter build apk --release
The APK will be at:
build/app/outputs/flutter-apk/app-release.apk
3

Build Android App Bundle (AAB)

For Play Store distribution:
flutter build appbundle --release
The AAB will be at:
build/app/outputs/bundle/release/app-release.aab
Android builds use cdylib (.so) format as JNI shared libraries.

Multi-Architecture Builds

iOS Universal Library

For supporting multiple iOS architectures:
# Build for device and simulator
cargo lipo --release \
  --targets aarch64-apple-ios,aarch64-apple-ios-sim \
  --package=dart-ffi
This creates a universal library that works on both devices and simulators.

Android Multi-ABI

For CI/production builds supporting multiple architectures:
cargo make --profile production-android appflowy-core-dev-android-ci
This builds for:
  • arm64-v8a (ARM64) - Modern devices
  • armeabi-v7a (ARMv7) - Older devices
Building for multiple ABIs significantly increases APK/AAB size.

Build Targets

iOS Targets

TargetArchitectureUse Case
aarch64-apple-iosARM64iOS devices (iPhone, iPad)
aarch64-apple-ios-simARM64iOS simulator on Apple Silicon Macs
x86_64-apple-iosx86_64iOS simulator on Intel Macs

Android Targets

TargetArchitectureUse Case
aarch64-linux-androidARM64Modern Android devices (2019+)
armv7-linux-androideabiARMv7Older Android devices
ARMv7 support may be deprecated in future versions. ARM64 covers 95%+ of active Android devices.

Platform-Specific Configuration

iOS Configuration

Minimum iOS Version: 11.0 In appflowy_flutter/ios/Podfile:
platform :ios, '11.0'
Info.plist Configuration: Ensure proper permissions are set in ios/Runner/Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>AppFlowy needs access to photos</string>
<key>NSCameraUsageDescription</key>
<string>AppFlowy needs access to camera</string>

Android Configuration

Minimum Android Version: API 29 (Android 10) In appflowy_flutter/android/app/build.gradle:
android {
    defaultConfig {
        minSdkVersion 29
        targetSdkVersion 34
    }
}
Permissions: In android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Device Testing

iOS Simulator

1

List available simulators

xcrun simctl list devices
2

Launch simulator

open -a Simulator
3

Run app

flutter run -d <simulator-id>

iOS Device

1

Connect device

Connect your iPhone/iPad via USB.
2

Trust computer

Unlock device and trust the computer.
3

Configure signing

Open Xcode and configure automatic signing:
open ios/Runner.xcworkspace
Select your team in Signing & Capabilities.
4

Run app

flutter run

Android Emulator

1

Create AVD

In Android Studio:
  1. Tools → Device Manager
  2. Create Virtual Device
  3. Select a device (e.g., Pixel 6)
  4. Download a system image (Android 10+)
2

Start emulator

flutter emulators --launch <emulator-id>
3

Run app

flutter run

Android Device

1

Enable developer options

On your Android device:
  1. Settings → About phone
  2. Tap “Build number” 7 times
2

Enable USB debugging

Settings → Developer options → Enable USB debugging
3

Connect device

Connect via USB and authorize the computer.
4

Verify connection

flutter devices
5

Run app

flutter run

Troubleshooting

Common mobile build issues and solutions:

iOS Build Fails

If you see stdbool.h file not found when building for simulator:
export SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path)
export BINDGEN_EXTRA_CLANG_ARGS="-target arm64-apple-ios14.0-simulator"
Then rebuild:
cargo make --profile development-ios-arm64-sim appflowy-core-dev-ios

Android Build Fails

Install NDK through Android Studio:
  1. Tools → SDK Manager
  2. SDK Tools tab
  3. Check “NDK (Side by side)”
  4. Apply
Then set environment variable:
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/<version>

Hot Reload & Development

Hot Reload

Flutter’s hot reload works on mobile:
# Press 'r' in terminal to hot reload
# Press 'R' to hot restart
# Press 'q' to quit
Hot reload only works for Dart code changes. Rust changes require a full rebuild.

Debugging

flutter run --debug
# Then press 'w' to open DevTools

App Distribution

iOS App Store

1

Configure App Store Connect

  1. Create app in App Store Connect
  2. Configure metadata, screenshots
  3. Set up TestFlight for beta testing
2

Build and archive

flutter build ios --release
Then archive in Xcode:
  1. Open ios/Runner.xcworkspace
  2. Product → Archive
  3. Distribute App → App Store Connect

Google Play Store

1

Create Play Console app

  1. Create app in Google Play Console
  2. Configure store listing
  3. Set up internal testing track
2

Generate signing key

keytool -genkey -v -keystore ~/appflowy.jks \
  -keyalg RSA -keysize 2048 -validity 10000 \
  -alias appflowy
3

Configure signing

Create android/key.properties:
storePassword=<password>
keyPassword=<password>
keyAlias=appflowy
storeFile=<path-to-jks>
4

Build and upload

flutter build appbundle --release
Upload build/app/outputs/bundle/release/app-release.aab to Play Console.

Next Steps

Testing

Learn how to run tests

Contributing

Contribute your changes

Building Desktop

Build for desktop platforms

Code Style

Follow coding conventions

Build docs developers (and LLMs) love