flet build command compiles your Flet Python app into a platform-specific executable or installable bundle. It supports building for desktop (macOS, Linux, Windows), web, Android (APK/AAB), and iOS (IPA).
Basic Usage
Target Platforms
The following target platforms are available:The platform or package type to build:
macos- macOS application bundle (.app)linux- Linux executable bundlewindows- Windows executableweb- Progressive Web App (PWA)apk- Android application packageaab- Android App Bundle (for Play Store)ipa- iOS application archiveios-simulator- iOS app for simulator testing
Build Platform Matrix
Not all platforms can be built from every operating system:| Command | Can be run on |
|---|---|
flet build macos | macOS only |
flet build linux | Linux only |
flet build windows | Windows only |
flet build web | macOS, Windows, Linux |
flet build apk | macOS, Windows, Linux |
flet build aab | macOS, Windows, Linux |
flet build ipa | macOS only |
flet build ios-simulator | macOS only |
Examples
Build for macOS
.app bundle in build/macos/.
Build for Windows
build/windows/.
Build Web App
build/web/.
Build Android APK
build/apk/.
Build iOS App
Build for Multiple Architectures
Arguments
Path to a directory with a Flet Python program. If omitted, uses the current directory.
Common Options
Output Directory
Output directory for the final executable/bundle.Default:
<python_app_path>/build/<target_platform>Project Metadata
Project name for bundle IDs and identifiers. Used as the default for artifact and product names.Falls back to
project.name in pyproject.toml.Display name shown in app launchers, window titles, and about dialogs.Falls back to
tool.flet.product in pyproject.toml.Short description of the application.Falls back to
project.description in pyproject.toml.Organization name in reverse domain notation (e.g., Used in bundle IDs:
com.mycompany).com.example.my-appCompany name to display in about app dialogs.
Versioning
Build number - an identifier used as an internal version number.On Android, this becomes
versionCode. On iOS, CFBundleVersion.Falls back to tool.flet.build_number in pyproject.toml.Build version - a Falls back to
x.y.z string used as the version number shown to users.project.version or tool.poetry.version in pyproject.toml.Architecture
Build for specific CPU architectures. Can be specified multiple times.macOS:
x64- Intel 64-bitarm64- Apple Siliconuniversal- Universal binary (both architectures)
arm64-v8a- 64-bit ARMarmeabi-v7a- 32-bit ARMx86_64- 64-bit Intel/AMD
Platform-Specific Options
Android Options
Split the APKs per ABI (Application Binary Interface).Creates separate APK files for each architecture, reducing download size.
Background color for Android adaptive icons.
Permissions to add to Format:
AndroidManifest.xml.<permission_name>=True|FalseFeatures to add to Format:
AndroidManifest.xml.<feature_name>=True|FalseAndroid Signing
Path to an upload keystore Can also be set via
.jks file.FLET_ANDROID_SIGNING_KEY_STORE environment variable.Android signing store password.Can also be set via
FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD environment variable.Android signing key password.Can also be set via
FLET_ANDROID_SIGNING_KEY_PASSWORD environment variable.Android signing key alias.Can also be set via
FLET_ANDROID_SIGNING_KEY_ALIAS environment variable.iOS Options
Apple Developer Team ID for signing iOS app bundle.Required for building
.ipa files.Provisioning profile name or UUID for signing and exporting iOS app bundle.
Export method for iOS app bundle.Options:
app-store, ad-hoc, enterprise, developmentDefault: developmentSigning certificate name, SHA-1 hash, or automatic selector.
Web Options
Base URL from which the app is served.Useful if hosting in a subdirectory.Falls back to
tool.flet.web.base_url in pyproject.toml.Flutter web renderer to use.Options:
auto, canvaskit, skwasmDefault: autoauto- Automatically choose based on devicecanvaskit- WebAssembly-based renderer (best compatibility)skwasm- Experimental WASM renderer (better performance)
FLET_WEB_RENDERER environment variable.Controls how routes are handled in the browser.Options:
path, hashDefault: pathpath- Uses HTML5 history API (/about)hash- Uses URL fragments (/#/about)
FLET_WEB_ROUTE_URL_STRATEGY environment variable.Initial background color for your web app during loading.Falls back to
tool.flet.web.pwa_background_color in pyproject.toml.Default color for your web app’s user interface (browser UI).Falls back to
tool.flet.web.pwa_theme_color in pyproject.toml.Disable loading of CanvasKit, Pyodide, and fonts from CDN.Use for offline deployments or air-gapped environments.Can also be set via
FLET_WEB_NO_CDN environment variable.Disable WASM target for web build.
macOS/iOS Options
Key-value pairs to add to Format:
Info.plist.<key>=<value>|True|FalseEntitlements for macOS builds.Format:
<key>=<value>|True|FalseAdvanced Options
Bundle ID
Bundle ID for the application (e.g., Used for iOS, Android, macOS, and Linux.
com.mycompany.app-name).Splash Screen
Background color of app splash screen.
Background color in dark mode.
Disable splash screen on web platform.
Disable splash screen on iOS platform.
Disable splash screen on Android platform.
Permissions
Pre-defined cross-platform permissions.Options: Automatically adds platform-specific permission declarations.
location, camera, microphone, photo_libraryDeep Linking
Deep linking URL scheme (e.g.,
https or myapp).Deep linking URL host.
Python Compilation
Pre-compile app’s Slightly improves startup time.
.py files to .pyc.Pre-compile site packages’
.py files to .pyc.Cleanup Options
Remove unnecessary app files upon packaging.
Remove unnecessary package files upon packaging.
Files and/or directories to exclude from the package.
Flutter Options
Additional arguments for the
flutter build command.Build Cache
Remove any existing build cache before starting the build process.Useful when builds are failing due to cached state.
Configuration File
Many build options can be set inpyproject.toml:
pyproject.toml settings.
Build Output
Build artifacts are placed in:Example Workflows
Build Desktop App with Custom Icon
Build Signed Android APK
Build Web App for GitHub Pages
Build iOS App for App Store
Troubleshooting
Build Fails with Cache Errors
iOS Build Fails Without Team ID
For.ipa builds, you must provide --ios-team-id:
Android Build Not Signed
Provide signing credentials:Next Steps
Publish Command
Deploy web apps
Pack Command
PyInstaller packaging
Distribution Guide
Learn about app distribution
Icons & Splash
Customize app appearance