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
- Getting Started
- Prerequisites
- Project Structure
- Publishing to Android
- Publishing to iOS
- Publishing to Linux
- Publishing to macOS
- Publishing to Windows
- Publishing to Web
- Common Configuration
- 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:
- Download from python.org
- Run the installer
- Important: Check "Add Python to PATH" during installation
- 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
- Visit Flutter SDK Download
- Download the latest stable release ZIP file
- Or download directly:
Step 2: Extract Flutter
- Extract the ZIP file to
C:\src\flutter(avoid paths with spaces or special characters) - Important: Do NOT extract to
C:\Program Files\
Step 3: Add Flutter to PATH
- Press
Win + R, typesysdm.cpl, press Enter - Click Advanced tab → Environment Variables
- Under User variables, find Path → Click Edit
- Click New → Add
C:\src\flutter\bin - 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
-
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"
-
Connect device to computer via USB cable
-
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
- Go to Apple Developer Portal
- Sign in with Apple Developer Account
- Click "+" to add new identifier
- Select "App IDs" → Continue
Step 2: Configure App ID
- Description: Enter descriptive name (e.g., "My Flet App")
- App ID Type: Select "App"
- Bundle ID: Choose "Explicit" and enter (e.g.,
com.mycompany.myfletapp) - App Services: Enable required services (Push Notifications, etc.)
- Click Continue → Register
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)
- Open Keychain Access (Cmd+Space → "Keychain Access")
- Menu: Keychain Access → Certificate Assistant → Request a Certificate From a Certificate Authority
- 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"
- Click Continue → Save
.certSigningRequestfile
Step 2: Create Certificate in Developer Portal
- Go to Apple Developer Certificates
- Click "+" button
- Select certificate type:
- Apple Development: For development/testing
- Apple Distribution: For App Store/Ad Hoc
- Click Continue
- Upload CSR file → Continue
- Download the
.cerfile - 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
- Go to Provisioning Profiles
- Click "+" button
- Select profile type:
- iOS App Development: For testing on devices
- Ad Hoc: For distributing to specific devices
- App Store: For App Store submission
- Click Continue
Step 2: Select App ID
- Choose your App ID
- Click Continue
Step 3: Select Certificate
- Choose appropriate certificate:
- iOS Development Certificate (for development profile)
- iOS Distribution Certificate (for Ad Hoc/App Store)
- Click Continue
Step 4: Select Devices (Development/Ad Hoc only)
- Select devices to include
- Click Continue
Step 5: Name and Generate
- Enter Profile Name (e.g., "My App Development Profile")
- Click Generate
- Download
.mobileprovisionfile
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:
-
Download Visual Studio 2022
- Community Edition (Free) is sufficient
-
Run the installer
-
Select Workload:
- Check "Desktop development with C++"
-
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
-
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:
- Press
Win + Ito open Settings - Go to Privacy & Security → For developers (Windows 11)
- Or Update & Security → For developers (Windows 10)
- Toggle Developer Mode to On
- 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:
- Static Website: Python runs in the browser (using Pyodide)
- 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
- Create GitHub repository
- Copy build output to repo
- Enable GitHub Pages:
- Go to Settings → Pages
- Select branch → Save
2. Netlify
- Create Netlify account
- Drag and drop
build/webfolder - Deploy
3. Vercel
npm install -g vercel
cd build/web
vercel
4. Cloudflare Pages
- Create Cloudflare account
- Upload
build/webfolder - 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:
- Heroku
- AWS/Google Cloud/Azure
- DigitalOcean
- 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 splashsplash_dark.png- Dark mode defaultsplash_android.png- Android-specificsplash_ios.png- iOS-specificsplash_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
--verboseflag 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
- Official Flet Documentation: https://docs.flet.dev/
- Flet Publishing Guide: https://docs.flet.dev/publish/
- Flet Discord: Join the community
- GitHub Issues: https://github.com/flet-dev/flet/issues
- Flet GitHub: https://github.com/flet-dev/flet
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:
- Plan your target platforms early in development
- Test on actual devices before distribution
- Follow platform guidelines for app store submissions
- Keep your certificates and keys secure
- Document your build process for your team
For the latest updates and detailed documentation, always refer to the Official Flet Documentation.
Additional Resources
- Getting Started: https://docs.flet.dev/getting-started/
- Publishing Overview: https://docs.flet.dev/publish/
- Android Publishing: https://docs.flet.dev/publish/android/
- iOS Publishing: https://docs.flet.dev/publish/ios/
- Linux Publishing: https://docs.flet.dev/publish/linux/
- macOS Publishing: https://docs.flet.dev/publish/macos/
- Windows Publishing: https://docs.flet.dev/publish/windows/
- Web Publishing: https://docs.flet.dev/publish/web/