Skip to main content

Packaging app for iOS

Introduction

Flet CLI provides flet build ipa command that allows packaging Flet app into an iOS archive bundle and IPA for distribution.

note

The command can be run on macOS only.

Prerequisites

Binary Python packages

Binary Python packages (vs "pure" Python packages written in Python only) are packages that partially written in C, Rust or other languages producing native code. Example packages are numpy, cryptography, or pydantic.

Flet provides an alternative index https://pypi.flet.dev to host Python binary wheels (.whl files downloaded by pip) for iOS and Android platforms.

The following packages are currently available for iOS:

NameVersion
aiohttp3.9.5
argon2-cffi-bindings21.2.0
bcrypt4.2.0
bitarray2.9.2
blis1.0.0
Brotli1.1.0
cffi1.17.1
contourpy1.3.0
cryptography43.0.1
google-crc321.6.0
grpcio1.67.1
kiwisolver1.4.7
lru-dict1.3.0
lxml5.3.0
MarkupSafe2.1.5
matplotlib3.9.2
numpy2.1.1
numpy1.26.4
opencv-python4.10.0.84
pandas2.2.2
pillow10.4.0
protobuf5.28.3
pydantic-core2.23.3
time-machine2.16.0
websockets13.0.1
yarl1.11.1
Work in progress

New packages can be built with creating a recipe in Mobile Forge project. For now, Flet team is authoring those recipes for you, but when the process is polished and fully-automated you'll be able to send a PR and test the compiled package right away.

If you don't yet see a package at https://pypi.flet.dev you can request it in Flet discussions - Packages. Please do not request pure Python packages. Go to package's "Download files" section at https://pypi.org and make sure it contains binary platform-specific wheels.

flet build ipa

Build an iOS archive bundle and IPA for distribution (macOS host only).

To successfully generate "runnable" IPA you should provide correct values for the following arguments:

  • --org - organization name in reverse domain name notation, e.g. com.mycompany (defaults to com.flet). The value is combined with --project and used as an iOS and Android bundle ID.
  • --project - project name in C-style identifier format (lowercase alphanumerics with underscores) used to build bundle ID and as a name for bundle executable. By default, it's the name of Flet app directory.
  • --team - team ID to locate provisioning profile. If no team ID provided a unsigned iOS archive will be generated.

You can also configure these settings in pyproject.toml:

[project]
name = "my-app"

[tool.flet]
org = "com.mycompany"

[tool.flet.ios]
team = "team_id"

Permissions

Setting iOS permissions which are written into Info.plist file:

flet build --info-plist permission_1=True|False|description permission_2=True|False|description ...

For example:

flet build --info-plist NSLocationWhenInUseUsageDescription="This app uses location service when in use."

Configuring iOS permissions in pyproject.toml:

[tool.flet.ios.info] # --info-plist
NSCameraUsageDescription = "This app uses the camera to ..."

Deep linking

You can configure deep-linking settings for iOS bundle with the following flet build options:

  • --deep-linking-scheme - deep linking URL scheme to configure for iOS and Android builds, i.g. "https" or "myapp".
  • --deep-linking-host - deep linking URL host.

The same can be configured in pyproject.toml:

[tool.flet.ios.deep_linking]
scheme = "https"
host = "mydomain.com"

See Deep linking section in Flutter docs for more information and complete setup guide.