Run/install/debug Android applications over Wi-Fi?

前端 未结 30 2314
[愿得一人]
[愿得一人] 2020-11-22 07:16

I thought there was a way to test your applications in development over Wi-Fi. Is this possible?

I\'d love to be able to untether my phone and develop wirelessly.

30条回答
  •  无人共我
    2020-11-22 08:03

    I wrote a simple script for Windows:

    Step 1. Make a batch file with the below commands and call the file wifi_dedug.bat and copy the below contents:

        adb tcpip 5555
        pause
        adb shell "ip addr show wlan0  | grep 'inet ' | cut -d' ' -f6|cut -d/ -f1" > tmpFile 
        pause
        set /p ip= < tmpFile 
        @echo %ip%
        del tmpFile
        @echo %ip%
        adb connect %ip%
        pause
    

    Step 2. connect your device to pc.

    Step 3. start batch file (key enter when requested)

    Step 4. disconnect your device and deploy/debug via wifi.

提交回复
热议问题