diff --git a/justfile b/justfile index b61d84af..241cea5c 100644 --- a/justfile +++ b/justfile @@ -11,6 +11,10 @@ pkg := ".?submodules=1#moonlight-android" build_flags := "--builders '' --print-build-logs" +# adb from nixpkgs (no system install needed). The adb server daemon persists +# between invocations, so `connect` in one recipe line carries to the next. +adb := "nix run nixpkgs#android-tools -- adb" + # list available recipes default: @just --list @@ -27,9 +31,19 @@ build: apk: build @ls -l result/app-nonRoot-debug.apk -# install the built debug APK onto a connected device/emulator (needs adb + USB debugging) +# install the built debug APK onto a USB-connected device/emulator (needs USB debugging) install: build - nix run nixpkgs#android-tools -- adb install -r result/app-nonRoot-debug.apk + {{ adb }} install -r result/app-nonRoot-debug.apk + +# install over WiFi to a Chromecast with Google TV (enable Developer options -> USB debugging first): just install-tv 192.168.1.x +install-tv ip: build + {{ adb }} connect {{ ip }}:5555 + {{ adb }} -s {{ ip }}:5555 install -r result/app-nonRoot-debug.apk + @echo "Installed. Launch Moonlight from the TV's app list (apps row / 'See all apps')." + +# disconnect a network adb device (e.g. the TV) when done +tv-disconnect ip: + {{ adb }} disconnect {{ ip }}:5555 # regenerate the offline Maven lockfile (deps.json) after changing dependencies deps: