Run/install/debug Android applications over Wi

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

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


See forum post Any way to view Android screen remotely without root? - Post #9.

  • Connect the device via USB and make sure debugging is working.
  • adb tcpip 5555
  • find the IP address with adb shell netcfg or adb shell ifconfig with 6.0 and higher
  • adb connect <DEVICE_IP_ADDRESS>:5555
  • Disconnect USB and proceed with wireless debugging.
  • adb -s <DEVICE_IP_ADDRESS>:5555 usb to switch back when done.
  • No root required!

    To find the IP address of the device: run adb shell and then netcfg . You'll see it there. To find the IP address while using OSX run the command adb shell ip route .


    WARNING : leaving the option enabled is dangerous, anyone in your network can connect to your device in debug, even if you are in data network. Do it only when connected to a trusted Wi-Fi and remember to disconnect it when done!


    @Sergei suggested that line 2 should be modified, commenting: "-d option needed to connect to the USB device when the other connection persists (for example, emulator connected or other Wi-Fi device)".

    This information may prove valuable to future readers, but I rolled-back to the original version that had received 178 upvotes.


    On some device you can do the same thing even if you do not have an USB cable :

  • Enable ADB over network in developer setting 屏幕截图显示选项 It should show the IP address
  • adb connect <DEVICE_IP_ADDRESS>:5555
  • Disable the setting when done

  • Using Android Studio there is a plugin allowing you to connect USB Debugging without the need of using any ADB command from a terminal.


    (No root required) There is one best, easy and with UI method for Android Studio

    IntelliJ and Android Studio plugin created to quickly connect your Android device over WiFi to install, run and debug your applications without a USB connected. Press one button and forget about your USB cable.

    just install plugin Android WiFi ADB

    Download and install Android WiFi ADB directly from

    Intellij / Android Studio: Preferences/Settings->Plugins->Browse Repositories

    在这里输入图像描述

    在这里输入图像描述

    .

    Remember! for first time to initialize the device you must have to connect using usb

    Alternatively, you can download the plugin from the JetBrains plugin site and install it manually in: Preferences/Settings->Plugins->Install plugin from disk.

    You can connect and manage your devices easily....... for more information read here https://github.com/pedrovgs/AndroidWiFiADB


    If you want to enable wireless adb on the device without connecting with a USB cable at all (root required):

  • Install a terminal app on the device (like Android Terminal Emulator) Type the following
  • su
  • setprop service.adb.tcp.port 5555
  • stop adbd
  • start adbd
  • Since you already have the terminal opened, you can find the IP address of the device:

    ip addr show
    

    Then in your debugging environment run command:

    adb connect ip.of.the.device
    

    This will make the device to be listed as any other emulators you might have. Note that the TCP will stay opened until you reset the device. You might also want to install a Wi-Fi Keep Alive app if you often experience disconnects.

    Remember to close the TCP when connecting to public networks if you want to feel safe. You can do the following or simply restart the device:

  • su
  • setprop service.adb.tcp.port -1
  • stop adbd
  • start adbd
  • 链接地址: http://www.djcxy.com/p/44204.html

    上一篇: Visual Studio 2010 C#在远程计算机上运行/调试

    下一篇: 通过Wi-Fi运行/安装/调试Android应用程序