From 6c077f5289a8aec3640125695bed6f884e9504c8 Mon Sep 17 00:00:00 2001 From: Oleks Date: Fri, 29 May 2026 19:07:58 +0300 Subject: [PATCH] justfile: fix adb invocation (nix shell --command) + add wireless-debugging recipes nix run nixpkgs#android-tools has no main binary; use nix shell --command adb. Add tv-pair/tv-connect/install-to for the Android 11+/Google TV wireless debugging flow (random port + pairing code) when :5555 isn't exposed. --- justfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 241cea5c..402a709f 100644 --- a/justfile +++ b/justfile @@ -12,8 +12,8 @@ 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" +# between invocations, so `connect`/`pair` in one recipe line carries to the next. +adb := "nix shell nixpkgs#android-tools --command adb" # list available recipes default: @@ -41,6 +41,18 @@ install-tv ip: build {{ 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')." +# Wireless-debugging pair (Developer options -> Wireless debugging -> Pair with code shows HOST:PAIRPORT + code): just tv-pair 192.168.88.19:37123 123456 +tv-pair host code: + {{ adb }} pair {{ host }} {{ code }} + +# connect after pairing, to the HOST:PORT on the main Wireless debugging screen (different port than pairing): just tv-connect 192.168.88.19:41234 +tv-connect host: + {{ adb }} connect {{ host }} + +# install the built APK to an explicit adb target (e.g. the wireless-debugging host:port) +install-to host: build + {{ adb }} -s {{ host }} install -r result/app-nonRoot-debug.apk + # disconnect a network adb device (e.g. the TV) when done tv-disconnect ip: {{ adb }} disconnect {{ ip }}:5555