Skip to content

Instantly share code, notes, and snippets.

@takahirom
Last active October 10, 2015 14:51
Show Gist options
  • Save takahirom/7126795a9bd836104735 to your computer and use it in GitHub Desktop.
Save takahirom/7126795a9bd836104735 to your computer and use it in GitHub Desktop.
If device only one, print device. Else use peco
adb devices|grep -v "List of devices"|awk 'NF==2{print $1}'|awk 'BEGIN{all=""} {all =$0"\n"all} END{if(NR==1) {print($0)} else{system("echo \""all "\"|peco") } }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment