ADB通过wifi控制机器

来源:互联网 发布:java后端技术栈 编辑:程序博客网 时间:2024/06/05 15:10

Wireless usage


adb is usually used over USB. However, it is also possible to use over Wi-Fi, as described here.

  1. Connect Android device and adb host computer to a common Wi-Fi network accessible to both. We have found that not all access points are suitable; you may need to use an access point whose firewall is configured properly to support adb.
  2. Connect the device with USB cable to host.
  3. Make sure adb is running in USB mode on host.
    $ adb usbrestarting in USB mode
  4. Connect to the device over USB.
    $ adb devicesList of devices attached######## device
  5. Restart host adb in tcpip mode.
    $ adb tcpip 5555restarting in TCP mode port: 5555
  6. Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#.
  7. Connect adb host to device:
    $ adb connect #.#.#.#connected to #.#.#.#:5555
  8. Remove USB cable from device, and confirm you can still access device:
    $ adb devicesList of devices attached#.#.#.#:5555 device

You're now good to go!

If the adb connection is ever lost:

  1. Make sure that your host is still connected to the same Wi-Fi network your Android device is.
  2. Reconnect by executing the "adb connect" step again.
  3. Or if that doesn't work, reset your adb host:
    adb kill-server
    and then start over from the beginning.
0 0