0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Android: Wifiで開発、デバッグのメモ

Last updated at Posted at 2020-10-14
  • Android Studio 4.0.1
  • Windows 10

Androidアプリの開発にて、Android端末と別の機器をUSBで接続して使う仕様でしたので、WiFi経由で実行、デバッグ、ログ出力をしました。

手順だけのメモとなります。

詳細は、参考にさせて頂いたこちらの記事をご参照ください。
AndroidアプリをWiFi経由でデバッグ
[Android]adbコマンドでunauthorizedが表示される

Android-PCをUSBケーブルで接続

[PC] Android Studioは立ち上げておく

[Android]開発者向けオプションをON, USBデバッグをON

[PC] AndroidのIPアドレスを調べる

powershell -Command $env:USERPROFILE\AppData\Local\Android\sdk\platform-tools\adb.exe shell ip addr
実行結果
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 34:97:f6:7a:83:a8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.124/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::3697:f6ff:fe7a:83a8/64 scope link
       valid_lft forever preferred_lft forever

[PC] TCP/IPデバッグに切り替え

powershell -Command $env:USERPROFILE\AppData\Local\Android\sdk\platform-tools\adb.exe tcpip 5555

ケーブルを抜く

[PC] TCP/IPで接続する

powershell -Command $env:USERPROFILE\AppData\Local\Android\sdk\platform-tools\adb.exe connect 192.168.1.124:5555

[PC] 確認

powershell -Command $env:USERPROFILE\AppData\Local\Android\sdk\platform-tools\adb.exe devices
実行結果
192.168.1.124:5555      device

うまくいかない場合

[Android]開発者向けオプションをOFF→ON, USBデバッグをOFF→ON

[PC] 終わるときは、USBデバッグに戻しておく

powershell -Command $env:USERPROFILE\AppData\Local\Android\sdk\platform-tools\adb.exe usb
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?