diff --git a/watch/wearos/run.sh b/watch/wearos/run.sh index dc747d6..fb178a7 100755 --- a/watch/wearos/run.sh +++ b/watch/wearos/run.sh @@ -308,6 +308,12 @@ apply_target() { fi if [[ -n "$ADB_SERIAL" ]]; then GRADLE_PROPS+=("-Pandroid.injected.device.serial=$ADB_SERIAL") + # AGP's `android.injected.device.serial` silently falls back to "all + # attached devices" when the serial doesn't match exactly (notably + # with mDNS-TLS serials like adb--._adb-tls-connect._tcp). + # ANDROID_SERIAL works one level deeper on every spawned adb binary, + # so the filter holds even when AGP's own matcher doesn't. + export ANDROID_SERIAL="$ADB_SERIAL" fi }