Skip to content

Instantly share code, notes, and snippets.

@jbarr21
Last active January 21, 2020 20:45
Show Gist options
  • Save jbarr21/aceefbe86b43073ad18e6a4a2e9adaa4 to your computer and use it in GitHub Desktop.
Save jbarr21/aceefbe86b43073ad18e6a4a2e9adaa4 to your computer and use it in GitHub Desktop.
Utilities for your BASH or ZSH profile that enable running ADB commands on multiple emulators/devices
# Utilities for your BASH or ZSH profile that enable running ADB commands on multiple emulators/devices
function prepend() { while read line; do echo "${1}${line}"; done; }
# requires ADB on $PATH
madb(){ for SERIAL in `adb devices | sed '1d;$d' | cut -f 1`; do adb -s $SERIAL "$@" | prepend "[$SERIAL] "; done; }
# requires https://github.com/ashishb/adb-enhanced
madbe(){ for SERIAL in `adb devices | sed '1d;$d' | cut -f 1`; do adbe -s $SERIAL "$@" | prepend "[$SERIAL] "; done; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment