Skip to content

Instantly share code, notes, and snippets.

View kamleshkarwande's full-sized avatar

Kamlesh Karwande kamleshkarwande

View GitHub Profile
@kamleshkarwande
kamleshkarwande / disconnectWifiAndroidShell.sh
Created May 29, 2018 14:47
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
kamleshkarwande / connectWifiAndroidShell.sh
Last active April 24, 2023 21:11
shell script to connect android devices over wifi.
#!/bin/bash
echo "This script works with ONLY one Android device connected to system !!!"
echo "Killing adb"
adb kill-server
sleep 2
PORT_NO=6969
CONNETED_DEVICES=$(adb devices | wc -l)
if [ "$CONNETED_DEVICES" -le 2 ]; then
echo "NO Android device connected to your machine via USB."
else