Building from source¶
How to set up a development environment and build Kite Ground Control yourself. The project uses just as its task runner for a consistent interface across Windows, Linux and macOS.
Heavy system dependencies are manual
The toolchains and system libraries below must be installed manually — they need administrative rights and significant system changes, so there are no automated scripts for them.
Prerequisites¶
All platforms¶
- Node.js LTS (v20 or v24)
- npm 11+ — keep it in sync across your dev machines. Older npm (10.x) rewrites
package-lock.jsonon every install by stripping thelibcfields of the optional native deps, so mixing versions makes the lockfile flip-flop. Upgrade withnpm install -g npm@latest(Node 22.9+ / 24 already bundle 11). - Rust (via rustup)
- just — strongly recommended
Windows (primary platform)¶
- Visual Studio Build Tools 2022 with the "Desktop development with C++" workload (the MSVC compiler/linker that Rust needs).
- WebView2 Runtime — usually already present on Windows 10/11; otherwise from Microsoft.
winget install OpenJS.NodeJS.LTS
winget install Casey.Just
winget install Rustlang.Rustup # or the installer from https://rustup.rs/
Restart your terminal
After installing any of these, fully restart your terminal and editor so the new PATH entries are picked up. A blank terminal that "can't find just/cargo/node" is almost always this.
Linux (Debian / Ubuntu based)¶
sudo apt update
sudo apt install -y \
build-essential pkg-config curl wget file \
libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev librsvg2-dev libxdo-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
Note
libwebkit2gtk-4.1-dev is the Tauri 2 / WebKitGTK 4.1 package — you need a distro new enough to
ship 4.1 (Ubuntu 22.04+ / Debian 12+). The two GStreamer dev packages are required by the native
RTSP video sink (the app links the system GStreamer at build time). Install Node.js, Rust and just
via their official methods.
Build on the oldest system you want to support
glibc is never bundled, so the highest GLIBC_* symbol in the binary becomes a hard minimum
for everyone running it. Building on Debian 13 produces something that will not start on Ubuntu
22.04. The release workflow builds on Ubuntu 24.04 (glibc 2.39). WebKitGTK and GStreamer are
not bundled either: every package uses the ones of the system it runs on.
macOS¶
- Xcode Command Line Tools —
xcode-select --install(compiler / linker + SDK). - Node.js, Rust and just via their official installers (e.g.
brew install node just, Rust from rustup).
The macOS build is universal (arm64 + x86_64). just build-macos adds both Rust targets and fetches
the bundled ffmpeg for you, then builds the .app + .dmg. The result is unsigned unless you
export a signing identity first.
For a distributable build, signing happens during the build and notarizing after it, in that order.
The .dmg has to wrap an already-signed .app, because Apple inspects the app inside the image:
export APPLE_SIGNING_IDENTITY="Developer ID Application: Your Name (TEAMID)"
just build-macos # the bundler signs the .app, then builds the .dmg around it
just notarize-macos # notarize + staple, so there is no Gatekeeper prompt
Both steps need an Apple Developer account, and specifically a Developer ID Application
certificate: an "Apple Development" certificate cannot notarize. Credentials are read from your
environment / keychain and never committed. List your identities with
security find-identity -v -p codesigning.
A release needs all three files from release/: the .dmg, the standalone .zip and the updater
_update.tar.gz. just notarize-macos staples the ticket to the disk image and to the app in the other two, so a first
launch works without a network connection. scripts/make-update-manifest.sh refuses an updater
archive without that ticket, which keeps the unsigned CI build out of the in-app updater.
Android¶
Mobile is not part of the 1.0 line — nothing mobile builds on release/1.0.x, and both mobile ports
target a release after 1.0. The iOS / iPadOS port lives on development (see the iOS notes above);
Android is described here.
Android runs the full app: tablets use the desktop layout, phones a dedicated landscape layout
(widget column, connection pop-out, docked video). Links: USB serial (OTG), Bluetooth LE
and UDP / TCP. While a link is up a foreground service keeps the process alive in the
background (TelemetryService.kt, driven from link_presence over JNI).
USB serial goes through the Android USB Host API, so the driver lives in Kotlin
(gen/android/app/src/main/java/com/kitegc/app/UsbSerial.kt) with a JNI shim in front of it
(src-tauri/src/transport/serial_android.rs). Two device families are driven:
| Family | Covers |
|---|---|
| CDC-ACM | INAV / Betaflight / ArduPilot flight controllers over USB, ESP32-S2/S3/C3 native USB |
| CP210x | Silicon Labs bridges — most SiK telemetry radios |
FTDI (RFD900) and CH340 are not driven yet; both slot in as another SerialDriver in that Kotlin
file. Android grants USB access per device and per session: plugging the cable in and picking Kite
from the system dialog grants it up front, otherwise the first connect raises the permission prompt.
Bluetooth LE follows the same shape on the platform's own GATT stack (BleSerial.kt with
src-tauri/src/transport/ble_android.rs in front of it) — the desktop's btleplug has no usable
Android backend without a companion Java library. The known BLE-serial profiles (CC2541 / HM-10,
Nordic UART, SpeedyBee) live in src-tauri/src/transport/ble_profiles.rs, shared with the desktop
backend, so a new adapter family is a one-line Rust change. The first scan raises the system's
"nearby devices" permission prompt (Android 12+; location before that).
Getting an APK without building one¶
The Release build workflow in GitHub Actions builds the APK beside the desktop packages and uploads
it as a run artifact — Actions → Release build → Run workflow. The runner already has the SDK, the
JDK and sdkmanager, so nothing has to be installed locally. It builds one APK per ABI: arm64 and
armv7 (32-bit ARM, armeabi-v7a). Without the signing secrets described below they are debug-signed
and named ..._debug.apk.
Signing¶
Release builds are signed with the debug keystore unless you supply a real one, because an APK with no signature at all cannot be installed — Android rejects it as an invalid package. That is enough to sideload, and not enough to publish.
⚠️ The debug keystore is generated per machine, and a CI runner is a fresh machine every run. So consecutive CI builds have different signatures, and Android refuses to install one over the other ("package conflicts with an existing package"). Updating then means uninstalling — which erases the flight database. Supply a real key and the problem disappears for good.
For CI, add four repository secrets and the workflow signs every build with the same key:
keytool -genkey -v -keystore kite.jks -alias kite -keyalg RSA -keysize 2048 -validity 10000
base64 -w0 kite.jks # → KEYSTORE_B64
| Secret | Value |
|---|---|
KEYSTORE_B64 |
base64 of the .jks |
KEYSTORE_PASSWORD |
store password |
KEY_ALIAS |
key alias (kite above) |
KEY_PASSWORD |
key password |
With none set the build still succeeds — it just warns and uses the throwaway key. Keep the .jks
and its passwords somewhere safe: lose them and you can never update an installed app again, only
replace it.
To sign with a real key, drop a key.properties next to gen/android/app/build.gradle.kts:
It is gitignored, so the key never lands in the repository.
Version code and the Play bundle¶
Android orders builds by an integer versionCode, and Google Play accepts an upload only with a higher
one than before. app/build.gradle.kts derives it from the version name in package.json
(playVersionCode):
major * 10_000_000 + minor * 100_000 + patch * 1_000 + stage * 10 + build
stage: -bN (or -betaN) = N (1–39) · -rcN = 40 + N (N 1–39) · final = 99 · -dev = 0
build: 0–9, from the environment variable KITE_ANDROID_BUILD (unset or empty = 0)
So 2.0.0-b1 is 20000010, 2.0.0-rc1 20000410, 2.0.0 20000990 and 2.0.1 20001990. A version name
outside this pattern stops the build with a message: another suffix, a beta or rc without a number or
with one outside 1–39, a minor or patch above 99, a major above 209, or a KITE_ANDROID_BUILD that is not
a digit.
Play never takes a code twice, not even after an upload was rejected or became invalid. The build
digit is for that case: set KITE_ANDROID_BUILD=1 (then 2, …; in PowerShell $env:KITE_ANDROID_BUILD = 1)
to upload the same version again. Build the APK of that release locally with the same value
(just build-android) — Android refuses to install a lower code over a higher one, and the GitHub
workflow always builds with 0. The file names in release/ do not carry the digit.
The App Bundle that Google Play takes is built locally only, one bundle with both ABIs — the GitHub workflow builds APKs:
Without key.properties the bundle is debug-signed, and Play refuses it. The bundle is for the Play
Console only; it does not belong on the GitHub release.
Building locally¶
- JDK 17 —
sudo apt install openjdk-17-jdk(or Temurin on Windows/macOS). - Android SDK — Android Studio, or just the command-line tools. Set
ANDROID_HOME. - NDK r27 —
sdkmanager --install "ndk;27.2.12479018", then pointNDK_HOMEat it. - Rust targets —
rustup target add aarch64-linux-android armv7-linux-androideabi, the two ABIs Kite is built for (i686-linux-android/x86_64-linux-androidonly for an x86 emulator).
npm ci
# APKs in src-tauri/gen/android/app/build/outputs/apk
npm run tauri android build -- --apk --split-per-abi --target aarch64 armv7
# on-device dev build with hot reload
npm run tauri android dev
A debug build is signed with your local debug key, so Android refuses to install it over a copy that
came from Google Play. Set KITE_ANDROID_DEV_ID=1 for the build and it gets its own application id
(com.kitegc.app.dev, shown as "Kite Dev") and installs beside the Play copy, with its own
data. tauri android dev then starts the app by the id in tauri.conf.json — the Play copy — so
start the dev copy yourself (adb shell am start -n com.kitegc.app.dev/com.kitegc.app.MainActivity);
on Windows tools/helpers/phone-emu.ps1 -Device -Beside does both.
src-tauri/gen/android is committed — it is the Android app project (manifest, Gradle build,
icons, the Rust Gradle plugin), edited by hand. Do not run tauri android init: it would
regenerate the project and overwrite the manifest's permissions and the landscape orientation.
To type-check the Rust side for Android without a full Gradle build, use just check-android, or by
hand:
BIN="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin"
export CC_aarch64_linux_android="$BIN/aarch64-linux-android24-clang"
export AR_aarch64_linux_android="$BIN/llvm-ar"
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$CC_aarch64_linux_android"
cargo check --manifest-path src-tauri/Cargo.toml --target aarch64-linux-android --lib
Those variables are not optional: cc-rs looks for an aarch64-linux-android-clang that the NDK does
not ship — its compilers are API-versioned (…android24-clang, matching minSdk) — so without them
the C dependencies (ring, bundled SQLite, zstd) fail to configure. tauri android build sets this
up itself, so only the bare cargo check needs it. (On Windows the prebuilt directory is
windows-x86_64 and the compilers are .cmd wrappers.)
What does not work yet on Android¶
| Feature | State | Why |
|---|---|---|
| UDP / TCP links | ✅ works | Plain sockets. |
| USB serial (CDC-ACM, CP210x) | ✅ works | Android USB Host API, driver in UsbSerial.kt. Needs an OTG cable. |
| USB serial (FTDI, CH340) | ❌ not implemented | Those two chips need their own driver; the devices are not listed as ports. |
| Flight log, missions, fleet & battery manager | ✅ works | SQLite in app-private storage (android::app_data_dir). |
| Maps, terrain, weather | ✅ works | Network + the same tile cache as desktop. |
| Widget layout editing by touch | ✅ works | Drag widgets between the docks with a finger in edit mode, same as with a mouse on desktop. |
| Screen stays on while armed | ✅ works | The display does not time out while the aircraft is armed, during a continuous raw recording, with a telemetry feed that carries no arming state, or always with Stay awake without connection; otherwise the normal OS timeout applies. |
| Bluetooth LE | ✅ works | Native GATT via BleSerial.kt; the same serial profiles as desktop. Listen-only mode (the GATT dump) is not implemented yet. |
| Joystick / HID RC control | ❌ not implemented | The backend is per-OS (WGI / evdev / IOKit); Android has none, so no device is ever listed. |
| Log import (.kflight / .rawmsp / .tlog) | ✅ works | Parsed in-process. A .kflight brings the flight, its track and its records; the archived original log files inside it (INAV blackbox, ArduPilot dataflash) are left behind — the mobile database never stores originals. ArduPilot .bin and PX4 .ulg import are desktop-only. |
| Blackbox import (.txt / .bbl / .bfl) | ❌ desktop-only | Not offered, like ArduPilot .bin and PX4 .ulg — the mobile database keeps no original log files. Import on a desktop and bring flights over as .kflight. |
| Video: camera / OTG capture device | ✅ works (tablets) | The WebView's own capture path (getUserMedia), no helper involved. Hidden on phones until the phone UI decides. |
| Video: RTSP (MJPEG / H.264 / HEVC) | ✅ works | Runs entirely on Kite's built-in RTSP client — no engine helpers (an Android app cannot spawn them, so the desktop engines are not offered). H.264/HEVC decode in device hardware onto a native surface below the WebView; MJPEG rides the multipart path. Native capture (ffmpeg) is not offered — the OS's own capture devices arrive through the camera kind. |
| Raw-log folder | ✅ move | Browse grants ONE folder via the system picker (scoped storage — no permission). The raw writers need real paths, which a SAF grant cannot provide, so they write app-private and the closed files are moved into the folder at session end (size read back, then the local file is deleted). The database stays app-private; it leaves and returns as a file (Settings → Data → Export / Import database). |
Exports to Documents/ |
⚠️ different | Scoped storage makes Documents a MediaStore collection, not a path — exports go through the system share/save dialog instead. |
Where a feature is missing the backend returns a clear message rather than failing to build, so the rest of the app is unaffected.
Workflow¶
just install # install frontend dependencies (npm install)
just dev # start development mode with hot reload
Other useful commands:
just --list # list all commands
just check # svelte-check + cargo check
just build # production build for the current platform
just build-windows # explicit Windows release build
just build-linux # explicit Linux release build
just build-macos # explicit macOS universal build (unsigned; adds mac targets + ffmpeg)
just clean # clean build artifacts
The classic commands still work too (npm install, npm run tauri dev, npm run tauri build).
Build outputs¶
Every build (just build / build-windows / build-linux / build-macos) gathers its final artifacts
into a release/ folder at the repo root, renamed to a unified scheme so local builds match the CI
release builds:
- Type =
installer(.exe/.deb/.rpm/.dmg, and the Android.apk),standalone(macOS only: the.appzipped),portable(the bare executable zipped with an empty.portablemarker), orupdate(macOS only: the.appas.tar.gz, what the in-app updater downloads). - In-app updates (Update and Restart in the update notice) need a
.sigbeside each installer and alatest.jsonmanifest on the GitHub release. Both are produced by the maintainer over the collectedrelease/folder (just update-manifest, i.e.scripts/make-update-manifest.sh) with a signing key that is not in the repository — a local build works without it, it just cannot be offered as an update. - The naming logic lives in
scripts/collect-release.*and is shared by local builds and the GitHub release workflow (.github/workflows/release.yml), so filenames match everywhere. just build-androiddrops its APKs into the same folder asKiteGC_Android_<abi>_<version>_installer.apk(one file per ABI:arm64andarmv7; the Play bundle holds both and is nameduniversal). It collects only the Android files and leaves the desktop outputs already inrelease/alone — an earlier desktop build's binaries still sit intarget/release/, and collecting those here would republish a stale one under the current version number. A desktop build, in turn, also picks up any Android release APK still lying in the Gradle outputs.
The folder is refreshed on each desktop build and is git-ignored (local to your machine). The raw
desktop outputs also remain in src-tauri/target/release/ (and its bundle/ subfolders) as usual; the
consumed installer bundles and APKs are removed so a stale file can never be re-collected under a newer
version.
Quality checks¶
runs npm run check (svelte-check + TypeScript) and cargo check. just check / just clean have
platform-specific variants (via just's [windows] / [unix] attributes) and pick the right one
automatically. CI runs the same checks (plus clippy) on every push and pull request; full release builds
are not run in CI.
Troubleshooting¶
just is not recognized
Restart your terminal/editor completely; verify with where.exe just (Windows). winget installs it
for the current user.
Editor terminal can't find just / cargo / node
Very common on Windows — fully close and reopen the editor (or reload the window).
Linker errors during cargo check / build (Windows)
You're missing the C++ build tools — install "Desktop development with C++" via the Visual Studio Installer.
Linux runtime notes¶
These are things to know when running the packaged Linux app (not build errors):
- Two helpers are fetched at runtime, not bundled:
ffmpeg(the classic video image path) andmediamtx(the classic RTSP → WebRTC engine) — the native RTSP client needs neither. Kite looks for each next to the executable, then in its own app-databin/directory, then onPATH, and offers to download it on first use. Each failure is local to its feature. On macOSffmpegis bundled as a universal sidecar instead;mediamtxis fetched the same way as everywhere else. INAV Blackbox logs are decoded in-process — no helper. - Serial permissions: add yourself to the
dialoutgroup (sudo usermod -aG dialout "$USER", then log out/in). Some distros useuucp. - Blank 3D globe / WebView (WebKitGTK): the 3D map runs in WebKitGTK, which is more fragile than Windows' WebView2 (notably on some Nvidia setups). Try launching with the DMA-BUF renderer disabled:
- Which package to test:
tauri buildproduces.deband.rpminsrc-tauri/target/release/bundle/; the raw binary sits in…/release/. - Data locations: installed mode stores the flight DB + terrain cache under
~/.local/share/kite-gc/. A portable build (a.portablemarker file next to the binary) keeps everything in adata/folder beside the binary.