Small bash wrappers around adb and scrcpy that add friendly mDNS names and an interactive device picker when more than one device is connected.
jdb—adbdrop-in. Resolves friendly names (viamdns-resolve) anywhere an IP would normally go, annotatesjdb devicesoutput with the friendly name, and prompts you to pick a device when more than one is attached and you didn't pass-s.jscrcpy—scrcpydrop-in with the same friendly-name resolution and device-picker behavior.mdns-resolve— Resolves a friendly name (or bare hostname) to an IP viaavahi-resolve, using a user-defined alias table. IP literals and unresolvable inputs pass through unchanged.adb-pick-device— Prints the serial of the connected device, prompting via/dev/ttywhen more than one is attached.
Drop the scripts somewhere on your PATH:
ln -s "$PWD"/{jdb,jscrcpy,mdns-resolve,adb-pick-device} ~/.local/bin/Requires adb, avahi-resolve (Debian/Ubuntu: avahi-utils), and optionally scrcpy.
Create ~/.config/mdns-resolve/hosts as a shell file mapping aliases to mDNS hostnames:
pixel=pixel-8.local
tablet=galaxy-tab.local
kiosk=lobby-kiosk.localThen:
jdb connect pixel # resolves "pixel" → mDNS → IP, adb connect <ip>:4242
jdb connect pixel tablet kiosk # connect to several devices in one go
jdb -s tablet shell # -s gets resolved too
jdb -s kiosk:5555 logcat # explicit port honored; otherwise defaults to 4242
jdb devices # rows get prefixed with friendly namesNames without an alias entry are tried as <name>.local directly. If avahi-resolve fails, the input is passed through to adb so things like IP literals still work.
When more than one device is connected and no -s/--serial is given, both jdb and jscrcpy invoke adb-pick-device, which lists devices (with friendly names where known) and prompts on /dev/tty. Subcommands that don't target a single device (start-server, kill-server, pair, mdns, etc.) pass through untouched.