Skip to content

Instantly share code, notes, and snippets.

@SpaceBison
Created January 24, 2017 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpaceBison/5ddf1a4112841de532109022b6c418b2 to your computer and use it in GitHub Desktop.
Save SpaceBison/5ddf1a4112841de532109022b6c418b2 to your computer and use it in GitHub Desktop.
Script to run an adb command on all connected devices (parallalel)
#!/bin/bash
adb devices | {
mapfile -s 1 -t DEVICES
for d in "${DEVICES[@]}"; do
DEV="${d%% *}"
if ! [[ -z $DEV ]]; then
if [[ $DEV == "????????????" ]]; then
echo "Unknown device!"
else
echo "adb -s $DEV $@ &"
adb -s $DEV "$@" &
fi
fi
done
wait
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment