macOS
Instructions for packaging a Flet app into a macOS application bundle.
See complementary information here.
Prerequisites#
Rosetta 2#
Flutter, which we use for packaging, requires Rosetta 2 on Apple Silicon:
Xcode#
Xcode 15 or later to compile native Swift or ObjectiveC code.
CocoaPods#
CocoaPods 1.16 or later to compile and enable Flutter plugins.
flet build macos
#
Note
This command can be run on a macOS only.
Creates a macOS application bundle from your Flet app.
Bundle architecture#
By default, flet build macos
command builds universal app bundle that works on both
Apple Silicon and older Intel processors. Therefore, packaging utility will try to download
Python binary wheels for both arm64
and x86_64
platforms. Recent releases
of some popular packages do not include x86_64
wheels anymore, so the entire packaging operation will fail.
You can limit the build command to specific architectures only, by using --arch
option.
For example, to build macOS app bundle that works on Apple Silicon only use the following command:
TBD: list some common/supported archs
Entitlements#
Key-value pairs that grant an executable permission to use a service or technology. Supported entitlements are defined in Apple Developer Entitlements Reference.
They can be set as follows:
They get written into specific .entitlements
files.