This gist provides a more flexible version of adb that exposes the functionality to select a device and then use that device's serial number in one or more adb commands. It expands on the initial implementation of the deeplinks.sh gist.
Companion blog post for usage is 🔗 here.
Companion posts for earlier versions of the script: Extending an Interactive ADB