Testing Flet app on iOS
Start building awesome mobile apps in Python using just your computer and mobile phone!
Install Flet app to your iOS device. You will be using this app to see how your Flet project is working on iPhone or iPad.
To get started on your computer you need Python 3.8 or greater installed.
Your iOS device and computer must be connected to the same Wi-Fi or local network.
It's recommended to start with the creation of a new virtual environment:
- macOS
- Linux
- Windows
python3 -m venv .venv
source .venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate
python.exe -m venv .venv
.venv\Scripts\activate.bat
Next, install the latest flet
package:
pip install flet --upgrade
Ensure that Flet has successfully installed and Flet CLI is available in PATH
by running:
flet --version
Create a new Flet project:
flet create my-app
cd my-app
Run the following command to start Flet development server with your app:
flet run --ios
A QR code with encoded project URL will be displayed in the terminal:
Open Camera app on your iOS device, point to a QR code and click Open in Flet link.
A dialog asking for permissions to access your local network will popup:
Click Allow and you should see your Flet app running.
Try updating main.py
(for example, replace a greeting of Text
control) - the app will be instantly refreshed on your iOS device.
You can try more complex Flet example from Introduction.
To return to "Home" tab either:
- Long-press anywhere on the screen with 3 fingers or
- Shake your iOS device.
You can also "manually" add a new project by clicking "+" button and typing its URL.
There is "Counter" Flet project hosted on the internet that you can add to Flet app to make sure everything works:
https://flet-counter-test-ios.fly.dev
Check "Gallery" tab for some great examples of what kind of projects could be done with Flet.
Explore Flet examples for even more examples.