Skip to content

Instantly share code, notes, and snippets.

@j796160836
Last active August 29, 2015 14:12
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 j796160836/9b135a8de4c44846fd82 to your computer and use it in GitHub Desktop.
Save j796160836/9b135a8de4c44846fd82 to your computer and use it in GitHub Desktop.
Use to connect android wear from android phone via bluetooth. Ref: http://developer.android.com/training/wearables/apps/bt-debugging.html
#!/bin/bash
DEVICE=`adb devices | sed '/List of devices/d' | sed '/:4444/d' | sed '/emulator/d' | sed '/vbox86p/d' | head -n 1 | awk '{print $1}'`
if [ "$DEVICE" == "" ]; then
echo "Please conntect devices!"
exit 0
else
echo "Devices: "$DEVICE
fi
adb -s $DEVICE forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment