Skip to content

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 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

When you run zkite dev:

  1. ZKite prepares and installs a preview build on the selected device under a separate development package identity.
  2. 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.
  3. It watches your supported Python source files and synchronizes changes over ADB.
  4. Stop the session at any time with Ctrl+C.
Terminal window
# Start live development preview
zkite dev
# Use custom port if default (8765) is busy
zkite dev --port 9000

When you run zkite run:

  1. ZKite compiles an APK tailored for your device architecture, signs it with the local project key (.zkite/debug.pem), installs it, and launches it.
  2. The application is completely autonomous: you can unplug the USB cable and run the app anywhere.
Terminal window
# Build, install, and launch standalone app
zkite run
# Follow Android system logs and Python stdout in your terminal
zkite run --logs

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 .py modules.
  • State values: compatible store fields retain their values across reloads; newly added fields take their declared defaults.
  • Changes to app.json (package identifier, permissions, app label, build settings).
  • Adding or modifying dependencies in requirements.txt or pyproject.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.