From 5991a4291a6243bf94c4145eb955db9ba6ff3ef4 Mon Sep 17 00:00:00 2001 From: Arnie Date: Fri, 12 Jun 2026 20:15:50 +0200 Subject: [PATCH] feat: add tv-deploy devshell command Connects adb, installs all flavor APKs, disconnects on exit (trap). tv-connect and tv-install kept for manual use. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 5 +++-- flake.nix | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1cd9354..9ff4806 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -33,9 +33,10 @@ post-25.11). No file rewriting; `gradle.properties` stays untouched. - All APKs: `gradle --no-daemon :app:assembleRelease` → `app/build/outputs/apk//release/-release.apk` - Single APK: `gradle --no-daemon :app:assembleWeatherRelease` -- Connect ADB: `tv-connect` (uses $TV_IP from .envrc) -- Sideload: `tv-install ` e.g. `tv-install weather` +- Deploy all: `tv-deploy` — connects, installs all flavor APKs, disconnects (bump `versionCode` in app/build.gradle.kts first for upgrades) +- Connect ADB: `tv-connect` (uses $TV_IP from .envrc) +- Single flavor: `tv-install ` e.g. `tv-install weather` - Fresh install: `adb uninstall cz.c3c.webviewkiosk. && tv-install ` ## Key facts diff --git a/flake.nix b/flake.nix index 17fe909..c598195 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,13 @@ shellHook = '' tv-connect() { adb connect "$TV_IP:5555"; } tv-install() { adb install -r "app/build/outputs/apk/$1/release/$1-release.apk"; } + tv-deploy() ( + trap 'adb disconnect "$TV_IP:5555"' EXIT + adb connect "$TV_IP:5555" || return 1 + for apk in app/build/outputs/apk/*/release/*.apk; do + adb install -r "$apk" || return 1 + done + ) ''; }; }