Development Cycle & Hot Reload
This content is for v1.1.0. Switch to the latest version for up-to-date documentation.
ZKite offers two distinct workflows: Development Preview (zkite dev) for instant feedback during coding, and Standalone Run (zkite run) for independent app testing.
Workflow Comparison
Section titled “Workflow Comparison”| Workflow | What It Is For | Requires Host Server? | Hot Reload? |
|---|---|---|---|
zkite dev |
Fast source-edit feedback and live synchronization on a connected device. | Yes (Runs while editing) | Yes (< 90ms) |
zkite run |
Builds, signs, installs, and launches a self-contained standalone app. | No (Runs independently) | No |
zkite build apk |
Generates installable .apk binary files for testing. |
No | No |
zkite build aab |
Generates production .aab bundles for Google Play distribution. |
No | No |
1. Development Preview (zkite dev)
Section titled “1. Development Preview (zkite dev)”When you run zkite dev:
- ZKite prepares and installs a preview build on the selected device under a separate development package identity.
- It displays your project icon with a development label. Having two launcher entries on your phone (the dev preview and the standalone app) is expected.
- It watches your supported Python source files and synchronizes changes over ADB.
- Stop the session at any time with Ctrl+C.
# Start live development previewzkite dev
# Use custom port if default (8765) is busyzkite dev --port 90002. Standalone Run (zkite run)
Section titled “2. Standalone Run (zkite run)”When you run zkite run:
- ZKite compiles an APK tailored for your device architecture, signs it with the local project key (
.zkite/debug.pem), installs it, and launches it. - The application is completely autonomous: you can unplug the USB cable and run the app anywhere.
# Build, install, and launch standalone appzkite run
# Follow Android system logs and Python stdout in your terminalzkite run --logsWhat Hot Reload Does and Does Not Reload
Section titled “What Hot Reload Does and Does Not Reload”Understanding reload boundaries avoids confusion during development:
Automatically Synchronized via Hot Reload:
Section titled “Automatically Synchronized via Hot Reload:”- Layout, styling utility classes, and widget hierarchy modifications.
- Event callbacks and helper functions in top-level
.pymodules. - State values: compatible store fields retain their values across reloads; newly added fields take their declared defaults.
Requires Restarting zkite dev:
Section titled “Requires Restarting zkite dev:”- Changes to
app.json(package identifier, permissions, app label, build settings). - Adding or modifying dependencies in
requirements.txtorpyproject.toml. - Replacing the app launcher icon file.
- Adding new files to
assets/.
Error Handling: Dev Preview vs. Standalone
Section titled “Error Handling: Dev Preview vs. Standalone”ZKite 1.1.0 provides differentiated error handling between development and release:
- In
zkite dev: Uncaught exceptions during startup, view rendering, or event callbacks display detailed, interactive on-screen error overlays with Python tracebacks. - In Standalone APK / AAB: Uncaught exceptions display a clean, user-friendly restart screen rather than exposing raw developer tracebacks on the mobile display.
- Diagnostic Logs: In all modes, full tracebacks and diagnostic logs are written to Android logcat and can be streamed in your terminal using
zkite run --logs.
