Skip to content

Instantly share code, notes, and snippets.

@loloof64
Created February 14, 2022 15:08
Show Gist options
  • Save loloof64/a4651bdd809861908589d3d449e85dcd to your computer and use it in GitHub Desktop.
Save loloof64/a4651bdd809861908589d3d449e85dcd to your computer and use it in GitHub Desktop.
Disconnect android wifi Linux
echo 'Disconnect your android device by WIFI'
echo '-----------------------------------'
echo 'You must first ensure that :'
echo '1) Your device enable USB connection in the developper settings,'
echo '2) adb (Android debug bridge) command is in your path,'
echo '3) your device and your computer are on the same Wifi network.'
ip_adress=$(adb devices | grep -o -P '192\.\d+\.\d+\.\d+' | sed -n 's/\(.*\)/\1/p')
adb disconnect $ip_adress > /dev/null
echo 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment