Skip to content

Instantly share code, notes, and snippets.

@PaulKinlan
Last active December 12, 2015 03:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PaulKinlan/4706201 to your computer and use it in GitHub Desktop.
Save PaulKinlan/4706201 to your computer and use it in GitHub Desktop.
Launch the same page across multiple connected Android devices. ./devicelab.sh http://paul.kinlan.me/
#!/bin/sh
# Usage:
# Open browser on all connected devices -
# ./devicelab.sh
# Open a url on all connected devices -
# ./devicelab.sh http://paul.kinlan.me/
adb kill-server
port=9220
for i in `adb devices|egrep -o [a-f0-9]{16}`; do
echo "Connecting to $i http://localhost:$port"
adb -s $i forward tcp:$port localabstract:chrome_devtools_remote
if [ $# -gt 0 ]
then
adb -s $i shell am start -a android.intent.action.VIEW -d $1
fi
let port++
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment