Last active
December 16, 2015 11:38
-
-
Save zaki50/5428583 to your computer and use it in GitHub Desktop.
adb を USB から wifi接続に切り替えるコマンド。
USB接続されてる端末が複数台あるときは ADB_OPTS="-s hogehoge" wifiadb で指定。
This file contains hidden or 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
wifiadb() | |
{ | |
addr=$(adb $ADB_OPTS shell ip -f inet -o addr show dev wlan0 | awk 'BEGIN { FS="[ /]+"} {print $4;}') | |
if [ x"$addr" = x"" ]; then | |
return 1; | |
fi | |
echo "addr: ${addr}" | |
adb $ADB_OPTS tcpip 5555 | |
adb connect ${addr}:5555 | |
unset addr | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment