Packaging app for iOS
Instructions for packaging a Flet app into an Xcode archive and, when signing is configured, an IPA for distribution.
This guide provides detailed on iOS-specific information. Complementary and more general information is available here.
Prerequisites
Rosetta 2
Some Flutter tooling and dependencies still ship as Intel binaries. Install Rosetta 2 on Apple Silicon if Flutter or CocoaPods prompts for it:
sudo softwareupdate --install-rosetta --agree-to-license
Xcode
Xcode 15 or later to compile native Swift or Objective-C code. Open Xcode once after installation to accept the license and install additional components.
CocoaPods
CocoaPods 1.16 or later to compile and enable Flutter plugins.
iOS wheels for binary Python packages
Binary Python packages (vs "pure" Python packages written in Python only)
are packages that are partially written in C, Rust, or other languages producing native code.
Example packages are numpy, cryptography, or pydantic-core.
Make sure all non-pure (binary) packages used in your Flet app have pre-built wheels for iOS.
flet build ios-simulator
This command can be run on macOS only.
Builds an (unsigned) iOS Simulator .app bundle, intended for testing on iOS Simulator
and does not require a signing certificate, provisioning profile, or Apple Developer Program setup.
flet build ipa
This command can be run on macOS only.
Builds an iOS app archive (.xcarchive) and, when signing is configured,
exports an .ipa for testing or distribution.
To generate an .ipa for testing on your device or uploading to App Store Connect
for distribution, you will need the following:
- Apple Developer Program subscription with access to App Store Connect
- Application Identifier
- Bundle ID configured in your Flet project (must match the App ID)
- Signing Certificate
- Provisioning Profile
Configuration options
Application Identifier (App ID)
A unique string that identifies your app within the Apple ecosystem. It is required to sign and distribute an iOS app and is used for various services like Push Notifications, App Groups, iCloud, and In-App Purchases.
It consists of two parts:
- Team ID: A unique 10-character string assigned by Apple to your developer account.
- Bundle ID: A reverse domain-style identifier for your app (e.g.,
com.example.myapp).
The Bundle ID in your Flet configuration must match the Bundle ID registered in the App ID.
Creating a new App ID
- Visit Apple Developer Portal.
- Sign in with your Apple Developer Account.
- Click the "+" button to add a new identifier.
- Select "App IDs" and click Continue.
- Enter a Description – This is just for reference (e.g., "MyApp Identifier").
- Choose the App ID Type:
- Select "App" for a standard iOS/macOS app.
- If you need an identifier for services like Apple Pay or Passbook, select the appropriate option.
- Bundle ID – Choose:
- Explicit Bundle ID (
com.example.myapp) – Recommended for most apps. - Wildcard Bundle ID (
com.example.*) – Allows multiple apps to use the same identifier (rarely used).
- Explicit Bundle ID (
- Enable App Services – Check the boxes for any services your app needs (e.g., Push Notifications, Sign in with Apple, etc.).
- Click Continue and Register.
Now you have Bundle ID and Team ID that will be used to identify your app.
Team ID
The developer team ID to include in export options.
Resolution order
Its value is determined in the following order of precedence:
--ios-team-id[tool.flet.ios.export_methods.EXPORT_METHOD].team_id[tool.flet.ios].team_id
Example
- flet build
- pyproject.toml
flet build ipa --ios-team-id ABCDEFE234
[tool.flet.ios]
team_id = "ABCDEFE234"
Signing Certificate
The certificate name, SHA-1 hash, or automatic selector to use for signing the iOS app bundle. Automatic selectors allow Xcode to pick the newest installed certificate of a particular type.
The available automatic selectors are:
"Apple Development""Apple Distribution""Developer ID Application""iOS Developer""iOS Distribution""Mac App Distribution""Mac Developer"
Generating a Certificate Signing Request (CSR)
Before creating a development or distribution certificate, you need a CSR (Certificate Signing Request).
- Open Keychain Access on your Mac (++cmd+space++, then search for "Keychain Access").
- In the top menu, go to Keychain Access → Certificate Assistant → Request a Certificate From a Certificate Authority…
- Fill in:
- User Email Address: Your Apple Developer email.
- Common Name: A descriptive name (e.g., "My App Distribution").
- CA Email Address: Leave this blank.
- Request is for: Select "Saved to disk".
- Click Continue, choose a location to save the
.certSigningRequestfile, and click Save.
Creating a Certificate in Apple Developer Portal
- Go to the Apple Developer Certificates Page.
- Click the "+" button to create a new certificate.
- Select "Apple Distribution" (for App Store & Ad Hoc) or "Apple Development" (for development) and click Continue.
- Upload the CSR file you created earlier and click Continue.
- Apple will generate the certificate. Click Download to get the
.cerfile. - Double-click the downloaded
.cerfile to install it in Keychain Access. - Open the Keychain Access app and ensure the certificate is installed under "login" keychain. The name of the development certificate usually starts with "Apple development:" and the name of the distribution certificate starts with "Apple distribution:".
Resolution order
Its value is determined in the following order of precedence:
--ios-signing-certificate[tool.flet.ios.export_methods.EXPORT_METHOD].signing_certificate[tool.flet.ios].signing_certificate
Example
- flet build
- pyproject.toml
flet build ipa --ios-signing-certificate "Apple Distribution"
[tool.flet.ios]
signing_certificate = "Apple Distribution"
Provisioning Profile
A Provisioning Profile is a file that allows an iOS app to run on physical devices and be distributed through the App Store or internally. It links your App ID, Developer/Distribution Certificate, and Registered Devices.
There are different types of provisioning profiles:
- Development Profile – Used for testing on physical devices.
- Ad Hoc Profile – Used for distributing an app outside the App Store to specific devices.
- App Store Profile – Used for submitting an app to the App Store.
- Enterprise Profile – Used for internal distribution within an organization.
Creating a New Provisioning Profile
Follow these steps to create a provisioning profile via the Apple Developer Portal:
Step 1: Go to Apple Developer Portal
- Visit the Apple Developer Portal;
- Sign in with your Apple Developer Account
Step 2: Create a New Provisioning Profile
- Click the "+" button to add a new provisioning profile;
- Choose the type of profile:
- iOS App Development – for testing on devices
- Ad Hoc – for distributing to specific devices
- App Store – for submitting an app to the App Store
- In-House – for internal distribution (Enterprise accounts only)
- Click Continue
Step 3: Select an App ID
- Choose the App ID that matches your app;
- Click Continue.
Step 4: Select a Distribution Certificate
- Choose the appropriate certificate:
- iOS Development Certificate - for iOS App Development profile
- iOS Distribution Certificate - for Ad Hoc or App Store profiles
- Click Continue.
Step 5: Select Registered Devices (for Development & Ad Hoc)
- If you selected an iOS App Development or Ad Hoc profile, select the devices to include;
- Click Continue.
Step 6: Name and Generate the Profile
- Enter a Profile Name (e.g.,
MyApp Development Profile); - Click Generate;
- Click Download to get the
.mobileprovisionfile.