Run your iOS app on the simulator or a device¶
This page shows you how to build and launch your app on the iOS Simulator, which needs no signing, and on a connected iPhone or iPad, which does.
Before you begin¶
- Configure your iOS app and lock it with
kivyforge lock -p ios. - For a device: a
team_idand an Apple account added to Xcode. See Sign your iOS app.
Run on the Simulator¶
-
Build, install, and launch the app:
kivyforge run -p ios --simulator--simulatoris the default target forrun, so you can omit it.runbuilds the app, boots a Simulator if none is running, installs the app, and launches it. -
Optional: to target a specific Simulator, list the available simulators and devices, then pass a name or UDID (unique device identifier) with
--destination:kivyforge run -p ios --list-devices kivyforge run -p ios --simulator --destination "DEVICE_NAME"Replace
DEVICE_NAMEwith a simulator name or UDID from the list.
Iterate on Python source
For development builds, the generated project links your app_dir through a
symbolic link. After you edit Python source, pressing Run in Xcode picks up
the change without rerunning kivyforge. Run kivyforge build again when you
change pyproject.toml.
Run on a device¶
- Set up signing. See Sign your iOS app.
-
Connect the device, then build, sign, install, and launch the app:
kivyforge run -p ios --deviceTo choose between several connected devices, pass
--destinationwith a device name or UDID fromkivyforge run -p ios --list-devices.
run streams the app's console to your terminal until the app ends. To end
it on the device, close it from the app switcher; going to the Home Screen
only suspends it. iOS often ends a closed app with SIGKILL, which devicectl
reports as "App terminated due to signal 9.", so run then exits with an
error even though the app ran normally. Pressing Ctrl+C in the terminal stops
run instead.
To install an app you already built, add --no-build.
Build without running¶
kivyforge build -p ios --simulatororkivyforge build -p ios --devicebuilds the.appwithout installing it.kivyforge build -p ioswith no target stops after generating the Xcode project, ready to open in Xcode.
Verify¶
The app window appears in the Simulator or on the device. To get the path of the
built .app, run a build command with --json and read data.artifacts:
kivyforge build -p ios --simulator --json