Publishing Flet App
Use the flet build command to package Flet applications into standalone executables or installable packages.
Prerequisites
flet build on for specific target platforms (Android, iOS, macOS, Linux, Windows, Web).PATH, it's downloaded automatically.Project Structure
Assumes a standard structure:
README.md
pyproject.toml
src/
assets/
icon.png
main.py
requirements.txt can be used instead of pyproject.toml, but flet build prioritizes pyproject.toml. Avoid pip freeze for requirements.txt.How it works
1. Creates an ephemeral Flutter project from a template.
2. Copies custom assets (icons, splash images).
3. Generates platform-specific icons and splash screens.
4. Packages the Python app using serious_python.
5. Runs flutter build .
6. Copies build results to build/.
Including Extensions
Add third-party Flet extensions to your project's dependencies in pyproject.toml or requirements.txt.
Configuration Options
--product CLI or tool.flet.product in pyproject.toml.--company CLI or tool.flet.company in pyproject.toml.--copyright CLI or tool.flet.copyright in pyproject.toml.tool.flet.flutter.dependencies in pyproject.toml.--output CLI or tool.flet.output in pyproject.toml.Assets
assets directory (icon_ios.png, icon_android.png, icon_web.png, icon_windows.ico/.png, icon_macos.png). Fallback to icon.png.assets (splash_dark_ios.png, splash_ios.png, etc.). Fallback order: platform-specific dark, platform-specific light, general dark, general, icon.--splash-color and --splash-dark-color CLI or tool.flet.splash.color/dark_color in pyproject.toml.
* **Disabling Splash Screens**: Enabled by default; refer to platform-specific docs.Screen Settings
tool.flet.app.boot_screen (show, message) and platform-specific settings.tool.flet.app.startup_screen (show, message) and platform-specific settings.Advanced Options
tool.flet.app.hide_window_on_start = true in pyproject.toml or -n with flet run.main.py using --module-name CLI or tool.flet.app.module in pyproject.toml.--compile-app, --compile-packages) and package cleanup (--cleanup-packages) via tool.flet.compile in pyproject.toml.location, camera, microphone, photo_library) via --permissions CLI or tool.flet.permissions in pyproject.toml. Mappings to platform-specific Info.plist, entitlements, and AndroidManifest.xml are provided.--build-number or tool.flet.build_number) and build version (--build-version or project.version/tool.poetry.version).--template or tool.flet.template.url), reference (--template-ref or tool.flet.template.ref), and directory (--template-dir or tool.flet.template.dir).--deep-linking-scheme/--deep-linking-host CLI or tool.flet.deep_linking in pyproject.toml.--project CLI or tool.flet.project in pyproject.toml.--org CLI or tool.flet.org in pyproject.toml.--bundle-id CLI or tool.flet.bundle_id in pyproject.toml (can be platform-specific).flutter build Arguments**: Pass arguments to flutter build via --flutter-build-args CLI or tool.flet.flutter.build_args in pyproject.toml.-v or -vv flags.print, logging) is redirected to console.log. Access via FLET_APP_CONSOLE env var. Special exit code 100 displays the log.
Previous
arrow_back
Permissionstatus