Created
November 1, 2017 08:11
-
-
Save tzutalin/06aa847782a7299cb86409dbf485a712 to your computer and use it in GitHub Desktop.
Android Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author : [email protected] | |
# Copyright [2015] <[email protected]> | |
PORT=5555 | |
if [ $# -ne 0 ]; then | |
while [ $# != 0 ] | |
do | |
PORT=$1 | |
shift | |
done | |
fi | |
echo "Ask ADB to listen to Port $PORT" | |
adb tcpip $PORT | |
adb wait-for-device | |
device_ip=$(adb shell netcfg | egrep -i 'wlan' | awk -F' ' '{print $3}' | awk -F'/' '{print $1}') | |
echo "Android device IP is $device_ip" | |
echo "$device_ip:$PORT" | |
adb connect "$device_ip:$PORT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment