Development Cycle & Hot Reload
ZKite offers two complementary execution modes: Development Preview (zkite dev) and Standalone Run (zkite run).
Preview vs. Standalone Run
Section titled “Preview vs. Standalone Run”| Command | Purpose | Hot Reload? | Works Offline / Detached? |
|---|---|---|---|
zkite dev |
Fast development iteration with live code watching | Yes (Instant) | No (Requires host connection) |
zkite run |
Full standalone production-like build on phone | No | Yes (Independent APK) |
1. zkite dev (The Fast Lane)
Section titled “1. zkite dev (The Fast Lane)”When you run zkite dev:
- ZKite installs a dedicated Development Preview APK on your authorized device.
- It sets up an encrypted communication bridge over
adb. - It watches your project directory for Python source file updates.
- As soon as you save a
.pyfile, ZKite transmits the changed code module and re-renders the active widget tree on the device.
# Start development previewzkite dev2. zkite run (Standalone Testing)
Section titled “2. zkite run (Standalone Testing)”When you run zkite run:
- ZKite bundles your code and standard library into a self-contained APK signed with your local development keystore.
- It installs and launches the app directly on the phone.
- You can disconnect your phone and take it with you—the app runs completely autonomously.
zkite runWhat Hot Reload Does and Does Not Reload
Section titled “What Hot Reload Does and Does Not Reload”Understanding the boundaries of hot reload will save you time:
- Instantly Hot-Reloaded:
- Changes to UI layout, styling classes, and widget hierarchies.
- Logic inside event callbacks and helper functions in top-level
.pyfiles. - State store definitions.
- Requires Restarting
zkite dev:- Adding or removing dependencies in
pyproject.toml. - Replacing app icon files (
icon.png). - Changes to native configuration or backend settings.
- Adding or removing dependencies in
Viewing Device Logs
Section titled “Viewing Device Logs”To view Python print statements, tracebacks, and Android runtime logs directly in your terminal:
# Follow logs during a standalone runzkite run --logs