先上官方原文:

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.

 

照着原文各种问题连不上,写的简单,实际复杂啊,现总结如下

准备工作:

1.PC和手机都已连上同一个WIFI。台式没无线的可以买个无线网卡或小米WIFI。

2.用PC ping 手机,要能ping通(手机IP一般能在「设置」-「关于手机」-「状态信息」-「IP地址」找到,或者是WIFI里高级选项;也可以在PC上进入adb,输入netcfg查看

3.用手机ping PC,要能ping通(此步可以先略过,不行再来做)。手机ping PC可以在手机上装个工具,我用的FPing。如果ping不通,先检查一下是不是关闭了所有的电脑管家、杀毒软件、WINDOWS自身的防火墙。


开始连接:

1.在PC的CMD中输入:adb tcpip 5555

2.断开USB连接。我就是困在这好久,不断开,按文档后面的步骤操作不了啊!

3.再次输入:adb connect 手机IP(如adb connect 192.168.1.101) 这样就OK了!

可以通过adb devices验证是否连接成功


断开链接:

在PC的CMD中输入:adb disconnect


参考:

http://www.docin.com/p-571648854.html

http://blog.csdn.net/chychc/article/details/8673360


-------------------------------------------------------------------------------------------------------------------

2016.11.9更新

不用USB线无线连接手机

1.在Android设备上安装一个终端模拟器,如Terminal Emulator for Android

https://github.com/jackpal/Android-Terminal-Emulator

2.打开Android设备上的终端模拟器,在里面依次运行命令:

su setprop service.adb.tcp.port 5555
其实就是把通过USB连接中的在PC的CMD中输入:adb tcpip 5555   一个作用

其他操作就跟通过USB连接一样了

转载于:https://www.cnblogs.com/songzhenhua/p/9312804.html

更多相关文章

  1. RF Analyzer for Android(安卓)安卓平台连接HackRF的App
  2. 自动输入文本效果—AutoCompleteTextView
  3. 测试手机多点触摸
  4. [置顶] Android基础--ConnectivityManager检查网络连接
  5. netty参考 android手机客户端
  6. Android判断网络连接
  7. 获取手机基本信息的工具类
  8. Android使用READ_CONTACTS读取手机联系人
  9. Android(安卓)EditText用户友好的输入界面

随机推荐

  1. Android第三十课 Jni 返回jstring字符串
  2. Android面试基础(三)——四大组件的介绍
  3. 原生Android应用中内嵌RN
  4. Android(安卓)SwipeRefreshLayout+Recycl
  5. android:WebView在没有网络情况下,点击当
  6. Android监听收到的短信
  7. 获取网络信息,ip,子网掩码,网关,dns
  8. Android中使用achartengine生成图表
  9. Android(安卓)实现RippleEffect水波纹效
  10. 天天记录 - Android抓包 - 抓取HTTP,TCP协