なんとなく面倒なのでスクリプトで。 USBで接続のあと #5555 で待たせて再起動する。 「restart」なので、kill-server → start-server は不要。 adb tcpip 5555 IPアドレスをコマンドラインから取得。 ip="$(adb shell ip route | awk '{print $9}')" そのIPにWiFi接続。 adb connect $ip まとめ ついでに、開発時には邪魔なスリープもOFFに。 adb shell svc power stayon true How to prevent an android device from entering sleep (via adb command shell) – Stack Overflow connect_via_wifi.sh #!/bin/sh adb tcpip 5555
![いまさらAndroid端末にすばやくWiFiで接続する](https://cdn-ak-scissors.b.st-hatena.com/image/square/f8d8d0792f2269846cc4afb8065e7b95f2c28b72/height=288;version=1;width=512/https%3A%2F%2Fandroid.benigumo.com%2Fwp-content%2Fplugins%2Fall-in-one-seo-pack%2Fimages%2Fdefault-user-image.png)