Skip to content

Instantly share code, notes, and snippets.

@jbarr21
Last active January 21, 2020 20:45
Show Gist options
  • Select an option

  • Save jbarr21/aceefbe86b43073ad18e6a4a2e9adaa4 to your computer and use it in GitHub Desktop.

Select an option

Save jbarr21/aceefbe86b43073ad18e6a4a2e9adaa4 to your computer and use it in GitHub Desktop.

Revisions

  1. jbarr21 renamed this gist Jan 21, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jbarr21 created this gist Jan 21, 2020.
    9 changes: 9 additions & 0 deletions madb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # 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; }