Skip to content

Instantly share code, notes, and snippets.

@JcMinarro
Created August 20, 2014 10:40
Show Gist options
  • Save JcMinarro/f59d45fbe6d31533c6dd to your computer and use it in GitHub Desktop.
Save JcMinarro/f59d45fbe6d31533c6dd to your computer and use it in GitHub Desktop.
Script to connect Android devices to ADB over tcpip
#/bin/bash
adb devices
echo "Waiting for device"
adb wait-for-device
ip=$(adb shell ifconfig wlan0 | cut -f3 -d ' ')
echo "Device ip: $ip"
echo "Setting Up tcpip port"
adb tcpip 5555
echo "Connecting to $ip"
adb connect $ip
@ligi
Copy link

ligi commented May 7, 2019

adapted so it works for me:

#/bin/bash
adb devices
echo "Waiting for device"
adb wait-for-device
ip=$(adb shell ifconfig wlan0 | cut -f3 -d ' ')
echo "Device ip: $ip"
echo "Setting Up tcpip port"
adb tcpip 5555
echo "Connecting to $ip"
adb connect $ip

might have been needed from a change in android tooling

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