Complete Guide: Publishing Flet Apps to Multiple Platforms

Complete Guide: Publishing Flet Apps to Multiple Platforms

This comprehensive guide provides step-by-step instructions for building and publishing Flet applications across different platforms including Android, iOS, Linux, macOS, Windows, and Web.

Official Flet Documentation: https://docs.flet.dev/


Table of Contents

  1. Getting Started
  2. Prerequisites
  3. Project Structure
  4. Publishing to Android
  5. Publishing to iOS
  6. Publishing to Linux
  7. Publishing to macOS
  8. Publishing to Windows
  9. Publishing to Web
  10. Common Configuration
  11. Troubleshooting

Getting Started

Before building and publishing your Flet app, you need to set up your development environment and create a Flet project.

Step 1: Install Python

Flet requires Python 3.9 or later.

🍎 macOS:

Check if Python is installed:

python3 --version

Install Python using Homebrew (recommended):

# Install Homebrew if not installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Python
brew install python

Or download from python.org


🪟 Windows:

Check if Python is installed:

python --version

Install Python:

  1. Download from python.org
  2. Run the installer
  3. Important: Check "Add Python to PATH" during installation
  4. Click "Install Now"

Verify installation (in new Command Prompt):

python --version
pip --version

🐧 Linux:

Check if Python is installed:

python3 --version

Install Python (Ubuntu/Debian):

sudo apt update
sudo apt install python3 python3-pip python3-venv

Install Python (Fedora):

sudo dnf install python3 python3-pip

Step 2: Install Flet

🍎 macOS / 🐧 Linux:

pip3 install flet

Verify installation:

flet --version

🪟 Windows:

pip install flet

Verify installation:

flet --version

Step 3: Create a New Flet Project

Create Project Directory

🍎 macOS / 🐧 Linux:

mkdir my-flet-app
cd my-flet-app

🪟 Windows (Command Prompt):

mkdir my-flet-app
cd my-flet-app

Windows (PowerShell):

New-Item -ItemType Directory -Name my-flet-app
Set-Location my-flet-app

Run Flet Create Command

This command creates a project structure with all necessary files:

All Platforms:

flet create

⚠️ Important: This will create/replace README.md and pyproject.toml in the current directory.

Created Structure:

my-flet-app/
├── README.md
├── pyproject.toml
├── src/
│   ├── assets/
│   │   └── icon.png
│   └── main.py          # Your main application code
└── storage/
    ├── data/
    └── temp/

Step 4: Create and Activate Python Virtual Environment

Using a virtual environment is highly recommended to isolate your project dependencies.


🍎 macOS / 🐧 Linux:

Create virtual environment:

python3 -m venv .venv

Activate virtual environment:

source .venv/bin/activate

You should see (.venv) prefix in your terminal:

(.venv) user@machine:~/my-flet-app$

Install dependencies:

pip install -r requirements.txt
# Or if using pyproject.toml
pip install -e .

Deactivate when done:

deactivate

🪟 Windows (Command Prompt):

Create virtual environment:

python -m venv .venv

Activate virtual environment:

.venv\Scripts\activate.bat

You should see (.venv) prefix:

(.venv) C:\Users\YourName\my-flet-app>

Install dependencies:

pip install -r requirements.txt

Deactivate when done:

deactivate

🪟 Windows (PowerShell):

Create virtual environment:

python -m venv .venv

Activate virtual environment:

.venv\Scripts\Activate.ps1

If you get execution policy error:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.venv\Scripts\Activate.ps1

You should see (.venv) prefix:

(.venv) PS C:\Users\YourName\my-flet-app>

Install dependencies:

pip install -r requirements.txt

Deactivate when done:

deactivate

Step 5: Test Your Flet App

Run your app to make sure everything is working:

🍎 macOS / 🐧 Linux:

# Make sure virtual environment is activated
flet run

# Or run the main file directly
python3 src/main.py

🪟 Windows:

REM Make sure virtual environment is activated
flet run

REM Or run the main file directly
python src\main.py

Expected Result: A window should open with your Flet app running.


Step 6: Install Additional Dependencies

If your app needs additional Python packages:

🍎 macOS / 🐧 Linux:

# Make sure virtual environment is activated
pip3 install package-name

# Save to requirements.txt
pip3 freeze > requirements.txt

🪟 Windows:

REM Make sure virtual environment is activated
pip install package-name

REM Save to requirements.txt
pip freeze > requirements.txt

Or add to pyproject.toml:

[project]
dependencies = [
    "flet",
    "requests",
    "your-other-package"
]

Quick Start Summary

🍎 macOS / 🐧 Linux - Full Workflow:

# 1. Create and navigate to project directory
mkdir my-flet-app && cd my-flet-app

# 2. Create Flet project structure
flet create

# 3. Create virtual environment
python3 -m venv .venv

# 4. Activate virtual environment
source .venv/bin/activate

# 5. Install dependencies
pip install -e .

# 6. Run the app
flet run

🪟 Windows - Full Workflow (Command Prompt):

REM 1. Create and navigate to project directory
mkdir my-flet-app && cd my-flet-app

REM 2. Create Flet project structure
flet create

REM 3. Create virtual environment
python -m venv .venv

REM 4. Activate virtual environment
.venv\Scripts\activate.bat

REM 5. Install dependencies
pip install -e .

REM 6. Run the app
flet run

🪟 Windows - Full Workflow (PowerShell):

# 1. Create and navigate to project directory
New-Item -ItemType Directory -Name my-flet-app
Set-Location my-flet-app

# 2. Create Flet project structure
flet create

# 3. Create virtual environment
python -m venv .venv

# 4. Activate virtual environment
.venv\Scripts\Activate.ps1

# 5. Install dependencies
pip install -e .

# 6. Run the app
flet run

Alternative: Using UV (Faster Package Manager)

Install UV:

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Create project with UV:

mkdir my-flet-app && cd my-flet-app
uv run flet create
uv run flet run

Alternative: Using Poetry (Dependency Management)

Install Poetry:

macOS/Linux:

curl -sSL https://install.python-poetry.org | python3 -

Windows (PowerShell):

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

Create project with Poetry:

mkdir my-flet-app && cd my-flet-app
poetry init
poetry add flet
poetry run flet create
poetry run flet run

Now that your project is set up, you're ready to build and publish your app! Continue to the Prerequisites section below.


Prerequisites

General Prerequisites for All Platforms

1. Python Installation

  • Python 3.9 or later required
  • Verify installation:
    python --version

2. Flet CLI Installation

Install or upgrade Flet:

pip install flet --upgrade

Verify installation:

flet --version

3. Flutter SDK Installation

Flutter is required to build Flet apps for any platform. While Flet CLI can automatically download Flutter during the first build (to $HOME/flutter/{version}), you can install it manually for better control.


🍎 macOS Instructions

Method 1: Automatic Installation (Recommended)

Let Flet automatically install Flutter on first build:

flet build <platform>

Flutter will be installed to ~/flutter/{version}

Method 2: Manual Installation

Step 1: Download Flutter SDK

For Apple Silicon (M1/M2/M3):

cd ~/development
curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_stable.zip
unzip flutter_macos_arm64_stable.zip

For Intel Mac:

cd ~/development
curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_stable.zip
unzip flutter_macos_stable.zip

Step 2: Add Flutter to PATH

Add to ~/.zshrc (default shell on macOS):

echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.zshrc
source ~/.zshrc

Or if using bash:

echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bash_profile
source ~/.bash_profile

Step 3: Verify Installation

flutter doctor

Step 4: Accept Licenses

flutter doctor --android-licenses

🪟 Windows Instructions

Method 1: Automatic Installation (Recommended)

Let Flet automatically install Flutter on first build:

flet build <platform>

Flutter will be installed to %USERPROFILE%\flutter\{version}

Method 2: Manual Installation

Step 1: Download Flutter SDK

  1. Visit Flutter SDK Download
  2. Download the latest stable release ZIP file
  3. Or download directly:

Step 2: Extract Flutter

  1. Extract the ZIP file to C:\src\flutter (avoid paths with spaces or special characters)
  2. Important: Do NOT extract to C:\Program Files\

Step 3: Add Flutter to PATH

  1. Press Win + R, type sysdm.cpl, press Enter
  2. Click Advanced tab → Environment Variables
  3. Under User variables, find Path → Click Edit
  4. Click New → Add C:\src\flutter\bin
  5. Click OK on all windows

Alternative using PowerShell (Run as Administrator):

[Environment]::SetEnvironmentVariable(
    "Path",
    [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\src\flutter\bin",
    "User"
)

Step 4: Verify Installation

Open new Command Prompt or PowerShell:

flutter doctor

Step 5: Accept Licenses

flutter doctor --android-licenses

🐧 Linux Instructions

Method 1: Automatic Installation (Recommended)

Let Flet automatically install Flutter on first build:

flet build <platform>

Method 2: Manual Installation

Step 1: Install Required Dependencies

sudo apt-get update
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa

Step 2: Download Flutter SDK

cd ~/development
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_stable.tar.xz
tar xf flutter_linux_stable.tar.xz

Step 3: Add Flutter to PATH

Add to ~/.bashrc:

echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bashrc
source ~/.bashrc

Step 4: Verify Installation

flutter doctor

Step 5: Accept Licenses

flutter doctor --android-licenses

4. Platform-Specific Build Matrix

The following table shows which OS is required to build for each platform:

Build On Android (APK/AAB) iOS (IPA) macOS Linux Windows Web
macOS
Windows ✅ (WSL)
Linux

Project Structure

Before building, ensure your Flet project follows this structure:

my-flet-app/
├── README.md
├── pyproject.toml          # Main configuration file
├── assets/                 # Optional: icons and splash screens
│   ├── icon.png           # Default icon (≥ 512×512 px)
│   ├── icon_android.png   # Android-specific (≥ 192×192 px)
│   ├── icon_ios.png       # iOS-specific (≥ 1024×1024 px)
│   ├── icon_web.png       # Web-specific (≥ 512×512 px)
│   ├── icon_windows.ico   # Windows-specific (256×256 px)
│   ├── icon_macos.png     # macOS-specific (≥ 1024×1024 px)
│   └── splash.png         # Splash screen image
└── src/
    └── main.py            # Main entry point

Quick Project Setup

Create a new Flet project with proper structure:

macOS/Linux:

flet create my-flet-app
cd my-flet-app

Windows (Command Prompt):

flet create my-flet-app
cd my-flet-app

Windows (PowerShell):

flet create my-flet-app
Set-Location my-flet-app

Sample pyproject.toml

[project]
name = "my-flet-app"
version = "1.0.0"
description = "My Flet Application"
readme = "README.md"
requires-python = ">=3.9"
authors = [{ name = "Your Name", email = "[email protected]" }]
dependencies = [
    "flet"
]

[tool.flet.app]
path = "src"

[tool.flet]
org = "com.mycompany"
product = "My Flet App"
company = "My Company"
copyright = "Copyright (C) 2025 My Company"

Publishing to Android

Platform-Specific Prerequisites

1. Android SDK and Java JDK

  • Java JDK: Will be auto-installed to $HOME/java/{version} if not present
  • Android SDK:
    • If Android Studio is installed, Flet will use its bundled SDK
    • Otherwise, will be auto-installed to $HOME/Android/sdk

2. Android Wheels for Binary Packages

Ensure all binary Python packages (like numpy, cryptography) have Android wheels available on PyPI.

Building Android APK

Basic Build Command

🍎 macOS:

flet build apk

🪟 Windows (Command Prompt):

flet build apk

Windows (PowerShell):

flet build apk

🐧 Linux:

flet build apk

This creates a "fat" APK containing binaries for both arm64-v8a and armeabi-v7a architectures.

Split APK by Architecture

To create smaller APKs for each architecture:

Using CLI:

flet build apk --split-per-abi

Using pyproject.toml:

[tool.flet.android]
split_per_abi = true

Building Android App Bundle (AAB)

Recommended for Google Play Store:

flet build aab

Signing Your Android App

Step 1: Create Upload Keystore


🍎 macOS:

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

Keystore location: ~/upload-keystore.jks


🪟 Windows (PowerShell):

keytool -genkey -v -keystore $env:USERPROFILE\upload-keystore.jks `
-storetype JKS -keyalg RSA -keysize 2048 -validity 10000 `
-alias upload

Keystore location: C:\Users\YourUsername\upload-keystore.jks

Windows (Command Prompt):

keytool -genkey -v -keystore %USERPROFILE%\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

🐧 Linux:

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

Important Notes:

  • Remember the keystore password and key alias!
  • Keep this file secure - never commit to source control
  • You'll be prompted for:
    • Keystore password (choose a strong password)
    • Key password (can be same as keystore password)
    • Your name and organization details

Step 2: Configure Signing


🍎 macOS - Using CLI:

flet build aab \
  --android-signing-key-store ~/upload-keystore.jks \
  --android-signing-key-alias upload \
  --android-signing-key-store-password YOUR_STORE_PASSWORD \
  --android-signing-key-password YOUR_KEY_PASSWORD

macOS - Using Environment Variables:

export FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD="your_store_password"
export FLET_ANDROID_SIGNING_KEY_PASSWORD="your_key_password"
flet build aab

🪟 Windows - Using CLI (PowerShell):

flet build aab `
  --android-signing-key-store $env:USERPROFILE\upload-keystore.jks `
  --android-signing-key-alias upload `
  --android-signing-key-store-password YOUR_STORE_PASSWORD `
  --android-signing-key-password YOUR_KEY_PASSWORD

Windows - Using Environment Variables (PowerShell):

$env:FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD="your_store_password"
$env:FLET_ANDROID_SIGNING_KEY_PASSWORD="your_key_password"
flet build aab

Windows - Using Environment Variables (Command Prompt):

set FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD=your_store_password
set FLET_ANDROID_SIGNING_KEY_PASSWORD=your_key_password
flet build aab

🐧 Linux - Using CLI:

flet build aab \
  --android-signing-key-store ~/upload-keystore.jks \
  --android-signing-key-alias upload \
  --android-signing-key-store-password YOUR_STORE_PASSWORD \
  --android-signing-key-password YOUR_KEY_PASSWORD

📝 Using pyproject.toml (recommended for all platforms):

[tool.flet.android.signing]
key_store = "~/upload-keystore.jks"  # macOS/Linux
# key_store = "C:\\Users\\YourUsername\\upload-keystore.jks"  # Windows
key_alias = "upload"

Note: Passwords are NOT stored in pyproject.toml for security. Use environment variables or CLI flags.

Installing APK to Device

  1. Enable USB Debugging on your Android device:

    • Go to Settings → About Phone
    • Tap "Build Number" 7 times to enable Developer Options
    • Go to Settings → Developer Options → Enable "USB Debugging"
  2. Connect device to computer via USB cable

  3. Install using ADB:


🍎 macOS:

# If Android SDK installed via Android Studio
~/Library/Android/sdk/platform-tools/adb install build/apk/app-release.apk

# Or if adb is in PATH
adb install build/apk/app-release.apk

🪟 Windows:

# If Android SDK installed via Android Studio
%LOCALAPPDATA%\Android\Sdk\platform-tools\adb.exe install build\apk\app-release.apk

# Or if adb is in PATH
adb install build\apk\app-release.apk

🐧 Linux:

# If Android SDK installed
~/Android/sdk/platform-tools/adb install build/apk/app-release.apk

# Or if adb is in PATH
adb install build/apk/app-release.apk

If multiple devices connected:

adb devices  # List all connected devices
adb -s DEVICE_ID install build/apk/app-release.apk

Disabling Splash Screen (Optional)

Using CLI:

flet build apk --no-android-splash

Using pyproject.toml:

[tool.flet.splash]
android = false

Output Location

Build results are in: build/apk/ or build/aab/


Publishing to iOS

Platform-Specific Prerequisites

Important: iOS builds can only be done on macOS!

1. Rosetta 2 (for Apple Silicon)

Only for M1/M2/M3 Macs:

sudo softwareupdate --install-rosetta --agree-to-license

Check if already installed:

pgrep -q oahd && echo "Rosetta is installed" || echo "Rosetta is NOT installed"

2. Xcode

Install Xcode 15 or later from the Mac App Store.

Verify Installation:

xcodebuild -version

Install Command Line Tools (if needed):

xcode-select --install

3. CocoaPods

Install CocoaPods 1.16 or later:

sudo gem install cocoapods

Verify installation:

pod --version

If gem install fails, try:

sudo gem install -n /usr/local/bin cocoapods

If gem install fails, try:

sudo gem install -n /usr/local/bin cocoapods

4. Apple Developer Program

  • Subscription: Required for App Store distribution
  • Access: To App Store Connect

5. iOS Wheels for Binary Packages

Ensure all binary Python packages have iOS wheels available.

Creating App ID

Step 1: Visit Apple Developer Portal

  1. Go to Apple Developer Portal
  2. Sign in with Apple Developer Account
  3. Click "+" to add new identifier
  4. Select "App IDs" → Continue

Step 2: Configure App ID

  1. Description: Enter descriptive name (e.g., "My Flet App")
  2. App ID Type: Select "App"
  3. Bundle ID: Choose "Explicit" and enter (e.g., com.mycompany.myfletapp)
  4. App Services: Enable required services (Push Notifications, etc.)
  5. Click ContinueRegister

Step 3: Note Your IDs

  • Team ID: 10-character string (e.g., ABCDEFE234)
  • Bundle ID: Your chosen ID (e.g., com.mycompany.myfletapp)

Creating Signing Certificate

Step 1: Generate Certificate Signing Request (CSR)

  1. Open Keychain Access (Cmd+Space → "Keychain Access")
  2. Menu: Keychain AccessCertificate AssistantRequest a Certificate From a Certificate Authority
  3. Fill in:
    • User Email: Your Apple Developer email
    • Common Name: Descriptive name (e.g., "My App Distribution")
    • CA Email: Leave blank
    • Request is: Select "Saved to disk"
  4. Click Continue → Save .certSigningRequest file

Step 2: Create Certificate in Developer Portal

  1. Go to Apple Developer Certificates
  2. Click "+" button
  3. Select certificate type:
    • Apple Development: For development/testing
    • Apple Distribution: For App Store/Ad Hoc
  4. Click Continue
  5. Upload CSR file → Continue
  6. Download the .cer file
  7. Double-click downloaded file to install in Keychain Access

Step 3: Verify Installation

Open Keychain Access → Check "login" keychain for:

  • "Apple Development: ..." (development cert)
  • "Apple Distribution: ..." (distribution cert)

Creating Provisioning Profile

Step 1: Create Profile

  1. Go to Provisioning Profiles
  2. Click "+" button
  3. Select profile type:
    • iOS App Development: For testing on devices
    • Ad Hoc: For distributing to specific devices
    • App Store: For App Store submission
  4. Click Continue

Step 2: Select App ID

  1. Choose your App ID
  2. Click Continue

Step 3: Select Certificate

  1. Choose appropriate certificate:
    • iOS Development Certificate (for development profile)
    • iOS Distribution Certificate (for Ad Hoc/App Store)
  2. Click Continue

Step 4: Select Devices (Development/Ad Hoc only)

  1. Select devices to include
  2. Click Continue

Step 5: Name and Generate

  1. Enter Profile Name (e.g., "My App Development Profile")
  2. Click Generate
  3. Download .mobileprovision file

Step 6: Install Provisioning Profile

Get profile UUID:

profile_uuid=$(security cms -D -i ~/Downloads/profile-name.mobileprovision | xmllint --xpath "string(//key[.='UUID']/following-sibling::string[1])" -)
echo $profile_uuid

Copy to provisioning profiles directory:

cp ~/Downloads/profile-name.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/${profile_uuid}.mobileprovision

List installed profiles:

for profile in ~/Library/MobileDevice/Provisioning\ Profiles/*.mobileprovision; do security cms -D -i "$profile" | grep -E -A1 '<key>(Name|UUID)</key>' | sed -n 's/.*<string>\(.*\)<\/string>/\1/p' | paste -d ' | ' - -; done

Building iOS App (IPA)

Configuration

Using pyproject.toml:

[tool.flet.ios]
team_id = "ABCDEFE234"
signing_certificate = "Apple Distribution"
provisioning_profile = "My App App Store Profile"

Build Commands


🍎 macOS - For App Store:

flet build ipa \
  --ios-team-id ABCDEFE234 \
  --ios-signing-certificate "Apple Distribution" \
  --ios-provisioning-profile "My App App Store Profile"

macOS - For Development/Testing:

flet build ipa \
  --ios-provisioning-profile "My App Development Profile"

Note:

  • iOS apps can only be built on macOS
  • For development builds, only provisioning profile is needed
  • Flet will automatically use the most recent "Apple Development" certificate

Output Location

Build results are in: build/ipa/


Publishing to Linux

Platform-Specific Prerequisites

Note: Linux builds can only be done on Linux (or WSL on Windows).

1. GStreamer (for Audio Control)

If your app uses Audio control:

Ubuntu/Debian (minimal):

sudo apt install libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

Ubuntu/Debian (full):

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc \
gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl \
gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

2. MPV (for Video Control)

If your app uses Video control:

Ubuntu/Debian:

sudo apt install libmpv-dev mpv

Building Linux Application

Basic Build Command

flet build linux

Including Video Support

flet build linux --include-packages flet_video

Output Location

Build results are in: build/linux/

The executable will be in: build/linux/x64/release/bundle/


Publishing to macOS

Platform-Specific Prerequisites

Important: macOS builds can only be done on macOS!

1. Rosetta 2 (for Apple Silicon)

Only for M1/M2/M3 Macs:

sudo softwareupdate --install-rosetta --agree-to-license

Check if already installed:

pgrep -q oahd && echo "Rosetta is installed" || echo "Rosetta is NOT installed"

2. Xcode

Install Xcode 15 or later from the Mac App Store.

Verify Installation:

xcodebuild -version

Install Command Line Tools (if needed):

xcode-select --install

3. CocoaPods

Install CocoaPods 1.16 or later:

sudo gem install cocoapods

Verify installation:

pod --version

If gem install fails, try:

sudo gem install -n /usr/local/bin cocoapods

Building macOS Application

Basic Build Command

🍎 macOS:

flet build macos

Note: macOS apps can only be built on macOS!


Building for Specific Architecture

By default, Flet builds universal binaries (both Apple Silicon and Intel). If you need architecture-specific builds:

Build for Apple Silicon only (M1/M2/M3):

Using CLI:

flet build macos --arch arm64

Using pyproject.toml:

[tool.flet.macos]
target_arch = ["arm64"]

Build for Intel only:

Using CLI:

flet build macos --arch x86_64

Using pyproject.toml:

[tool.flet.macos]
target_arch = ["x86_64"]

Build Universal (both architectures):

flet build macos --arch arm64 --arch x86_64

Configuring Entitlements

Entitlements grant permissions to use services or technologies.

Using pyproject.toml:

[tool.flet.macos.entitlement]
"com.apple.security.app-sandbox" = false
"com.apple.security.cs.allow-jit" = true
"com.apple.security.network.client" = true
"com.apple.security.network.server" = true

Using CLI:

flet build macos --macos-entitlements "com.apple.security.network.client"=true

Output Location

Build results are in: build/macos/

The app bundle will be: build/macos/Build/Products/Release/MyApp.app


Publishing to Windows

Platform-Specific Prerequisites

Important: Windows builds can only be done on Windows!

1. Visual Studio 2022

Install Visual Studio 2022 with Desktop development with C++ workload.

Installation Steps:

  1. Download Visual Studio 2022

    • Community Edition (Free) is sufficient
  2. Run the installer

  3. Select Workload:

    • Check "Desktop development with C++"
  4. Verify these components are included:

    • MSVC v143+ (Microsoft Visual C++ compiler)
    • Windows 10/11 SDK
    • C++ CMake tools for Windows
    • C++ ATL for latest build tools
  5. Click Install (requires ~6-7 GB)

Verify Installation:

Open Developer Command Prompt for VS 2022 and run:

cl

You should see the Microsoft C/C++ compiler version.

Alternative - Verify via PowerShell:

& "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
cl

2. Enable Developer Mode

If you encounter symlink errors, enable Developer Mode:

Method 1 - Using Settings App:

  1. Press Win + I to open Settings
  2. Go to Privacy & SecurityFor developers (Windows 11)
    • Or Update & SecurityFor developers (Windows 10)
  3. Toggle Developer Mode to On
  4. Click Yes to confirm

Method 2 - Using Command:

start ms-settings:developers

Method 3 - Using PowerShell (Admin):

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

Verify Developer Mode:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense"

Building Windows Application

Basic Build Command

🪟 Windows (Command Prompt):

flet build windows

Windows (PowerShell):

flet build windows

Note: Windows apps can only be built on Windows!

Build Output

  • Build results: build\windows\
  • Executable location: build\windows\x64\runner\Release\
  • Main executable: your_app.exe

Running the Built App

Navigate to build directory:

cd build\windows\x64\runner\Release
your_app.exe

Or run directly:

.\build\windows\x64\runner\Release\your_app.exe

Publishing to Web

Flet supports two types of web deployment:

  1. Static Website: Python runs in the browser (using Pyodide)
  2. Dynamic Website: Python runs on the server

Comparison: Static vs Dynamic

Feature Static Website Dynamic Website
Loading Time Slower (loads Python runtime) Faster
Python Compatibility Limited (Pyodide constraints) Full compatibility
Responsiveness Zero latency Network latency
Performance 3-5x slower (WASM) Native speed
Code Protection Low (code in browser) High (code on server)
Hosting Free/Cheap (static hosting) Paid (requires server)

Building Static Web App

Basic Build Command

flet build web

Build Output

Build results are in: build/web/

Deploying Static Web App

Static web apps can be hosted on:

1. GitHub Pages

  1. Create GitHub repository
  2. Copy build output to repo
  3. Enable GitHub Pages:
    • Go to Settings → Pages
    • Select branch → Save

2. Netlify

  1. Create Netlify account
  2. Drag and drop build/web folder
  3. Deploy

3. Vercel

npm install -g vercel
cd build/web
vercel

4. Cloudflare Pages

  1. Create Cloudflare account
  2. Upload build/web folder
  3. Deploy

Running Dynamic Web App

For dynamic websites, you need to run your Flet app on a server:

flet run --web --port 8000

With specific host:

flet run --web --host 0.0.0.0 --port 8000

Deploying Dynamic Web App

Dynamic apps can be hosted on:

  1. Heroku
  2. AWS/Google Cloud/Azure
  3. DigitalOcean
  4. Your own VPS

Example Procfile for Heroku:

web: flet run --web --host 0.0.0.0 --port $PORT

Common Configuration

Product Name

The display name for your application.

CLI:

flet build <platform> --product "My Awesome App"

pyproject.toml:

[tool.flet]
product = "My Awesome App"

Company Name

CLI:

flet build <platform> --company "My Company Inc."

pyproject.toml:

[tool.flet]
company = "My Company Inc."

Copyright

CLI:

flet build <platform> --copyright "Copyright © 2025 My Company Inc."

pyproject.toml:

[tool.flet]
copyright = "Copyright © 2025 My Company Inc."

Custom Output Directory

CLI:

flet build <platform> --output /path/to/output

pyproject.toml:

[tool.flet]
output = "/path/to/output"

Organization ID

Used for bundle identifiers (e.g., com.mycompany):

[tool.flet]
org = "com.mycompany"

Icons Configuration

Place icons in assets/ directory:

Platform File Name Size Notes
iOS icon_ios.png ≥ 1024×1024 px No transparency
Android icon_android.png ≥ 192×192 px
Web icon_web.png ≥ 512×512 px
Windows icon_windows.ico or .png 256×256 px
macOS icon_macos.png ≥ 1024×1024 px
Default icon.png ≥ 512×512 px Fallback for all

Splash Screen Configuration

Splash Images:

Place in assets/ directory:

  • splash.png - Default splash
  • splash_dark.png - Dark mode default
  • splash_android.png - Android-specific
  • splash_ios.png - iOS-specific
  • splash_web.png - Web-specific

Splash Colors:

[tool.flet.splash]
color = "#ffffff"           # Light mode background
dark_color = "#333333"      # Dark mode background

Or via CLI:

flet build <platform> --splash-color #ffffff --splash-dark-color #333333

Troubleshooting

Common Issues

1. Flutter SDK Not Found

Solution: Install Flutter manually or let Flet auto-install on first build.

2. Android Build Fails - Java/SDK Missing

Solution: Let Flet auto-install or install manually:

  • JDK: Install from OpenJDK
  • Android SDK: Install Android Studio

3. iOS Build Fails - Certificate Issues

Solutions:

  • Verify certificate is installed in Keychain Access
  • Check certificate hasn't expired
  • Ensure certificate type matches profile type

4. Windows Build Fails - Symlink Error

Solution: Enable Developer Mode in Windows Settings

5. Binary Package Not Available for Platform

Solution: Check if package has wheels for target platform on PyPI. Consider alternatives or build from source.

6. Build Takes Too Long

Solution:

  • First build: Always slower (downloads Flutter SDK, dependencies, etc.)
    • macOS: ~10-20 minutes
    • Windows: ~15-25 minutes
    • Linux: ~10-20 minutes
  • Subsequent builds: Much faster (5-10 minutes)
  • Use --verbose flag to see progress:
    flet build <platform> --verbose
  • Check your internet connection - slow downloads can significantly increase build time

7. Splash Screen Not Showing

Solution:

  • Verify image files are in assets/ directory
  • Check image format (PNG recommended)
  • Ensure proper naming convention

Getting Help

Verbose Build Output

For debugging, use verbose mode:

macOS/Linux:

flet build <platform> --verbose

Windows:

flet build <platform> --verbose

This shows detailed build progress including:

  • Flutter SDK download/installation
  • Dependency resolution
  • Compilation steps
  • Package creation

Checking Build Requirements

macOS:

# Check Flutter installation
flutter doctor -v

# Check Xcode setup (for iOS/macOS builds)
xcodebuild -version

# Check CocoaPods
pod --version

Windows:

REM Check Flutter installation
flutter doctor -v

REM Check Visual Studio installation
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" /?

Linux:

# Check Flutter installation
flutter doctor -v

# Check required libraries
ldconfig -p | grep gtk
ldconfig -p | grep gstreamer

Quick Reference Commands

Create New Project

macOS/Linux:

flet create my-app

Windows:

flet create my-app

Build Commands by Platform

All Platforms - Android

# APK
flet build apk

# AAB (for Play Store)
flet build aab

macOS Only - iOS

flet build ipa

Linux Only (or WSL on Windows)

flet build linux

macOS Only

flet build macos

Windows Only

flet build windows

All Platforms - Web

flet build web

Platform Build Capability Matrix

Your OS Can Build For
🍎 macOS Android (APK/AAB), iOS (IPA), macOS, Web
🪟 Windows Android (APK/AAB), Linux (WSL), Windows, Web
🐧 Linux Android (APK/AAB), Linux, Web

Running Development Server

macOS/Linux:

# Desktop
flet run

# Web
flet run --web

# Web with specific port
flet run --web --port 8000

# Web with specific host and port
flet run --web --host 0.0.0.0 --port 8000

Windows (Command Prompt):

REM Desktop
flet run

REM Web
flet run --web

REM Web with specific port
flet run --web --port 8000

Windows (PowerShell):

# Desktop
flet run

# Web
flet run --web

# Web with specific port
flet run --web --port 8000

Conclusion

This guide covers the complete process of publishing Flet applications to all major platforms. Remember:

  1. Plan your target platforms early in development
  2. Test on actual devices before distribution
  3. Follow platform guidelines for app store submissions
  4. Keep your certificates and keys secure
  5. Document your build process for your team

For the latest updates and detailed documentation, always refer to the Official Flet Documentation.

Additional Resources