Skip to content

macOS

Instructions for packaging a Flet app into a macOS application bundle.

Info

This guide provides detailed macOS-specific information. Complementary and more general information is available here.

Prerequisites#

Rosetta 2#

Flutter, which we use for packaging, requires Rosetta 2 on Apple Silicon:

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

Xcode#

Xcode 15 or later is required to compile native Swift or Objective-C code.

CocoaPods#

CocoaPods 1.16 or later is required to install and compile Flutter plugins.

flet build macos#

Note

This command can be run on macOS only.

Builds a macOS application bundle from your Flet app.

Target architecture#

By default, flet build macos creates a universal bundle that runs on both Apple Silicon and Intel Macs. Packaging downloads Python wheels for both arm64 and x86_64 architectures.

To limit packaging to a specific architecture, see this. This affects which Python wheels are bundled and, in turn, which CPU architectures the app will run on. You will then have to provide your users with the correct build for their Macs.

Info.plist#

It is possible to add or override Info.plist entries for macOS builds. These values are written to macos/Runner/Info.plist in the build template.

Resolution order#

Its value is determined in the following order of precedence:

  1. --info-plist
  2. [tool.flet.macos].info
  3. Values injected by permissions

CLI booleans must be True or False (case-sensitive). For lists or nested structures, use TOML in [tool.flet.macos].info.

Example#

flet build macos --info-plist LSApplicationCategoryType="public.app-category.utilities"
[tool.flet.macos.info]
LSApplicationCategoryType = "public.app-category.utilities"

Entitlements#

Entitlements are boolean key-value pairs that grant an executable permission to use a service or technology. Supported entitlements are defined in the Apple Developer Entitlements Reference.

Entitlements are written to macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements in the build template.

Resolution order#

Its value is determined in the following order of precedence:

  1. --macos-entitlements
  2. [tool.flet.macos.entitlement]
  3. Values injected by permissions
  4. Defaults: 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 "com.apple.security.files.user-selected.read-write" = true

CLI values are True or False (case-sensitive). In pyproject.toml, use true/false.

Example#

flet build macos --macos-entitlements com.apple.security.network.client=True com.apple.security.app-sandbox=False
[tool.flet.macos.entitlement]
"com.apple.security.network.client" = true
"com.apple.security.app-sandbox" = false