Skip to content

Instantly share code, notes, and snippets.

@kamleshkarwande
Created May 29, 2018 14:47
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 kamleshkarwande/92a2421ee3f1881ed10d59949b6a4e4d to your computer and use it in GitHub Desktop.
Save kamleshkarwande/92a2421ee3f1881ed10d59949b6a4e4d to your computer and use it in GitHub Desktop.
shell script to disconnect android devices over wifi.
#!/bin/bash
echo "This script works with ONLY one Android device connected to system !!!"
IP_PORT=$(adb devices | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | awk '{print $1}')
if [ -z "$IP_PORT" ]; then
echo "NO Device connected via wifi."
else
adb -s $IP_PORT usb
echo "ENJOY usb debug :)"
fi
@kamleshkarwande
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment