天天看点

使用adb无线连接手机进行开发和调试,适用于usb host/accessory设备调试

原文:http://developer.android.com/guide/topics/connectivity/usb/index.html

Connect the Android-powered device via USB to your computer.

From your SDK <code>platform-tools/</code> directory, enter <code>adb tcpip 5555</code> at    the command prompt.

Enter <code>adb connect &lt;device-ip-address&gt;:5555</code> You should now be connected    to the Android-powered device and can issue the usual <code>adb</code> commands like <code>adb    logcat</code>.

To set your device to listen on USB, enter <code>adb usb</code>.

基本意思是:

首先还是用USB线连接手机,然后找到Android SDK的playform-tools目录,在此通过命令行运行: adb tcpip 5555。在UBUNTU系统中,会返回“restarting in TCP mode port:5555”。

接下来,设置手机连接wifi,最好与PC是同一网段,不同网段没试过。然后,找到手机的IP,比如我的是192.168.0.142。(什么?不知道在哪里看手机IP?设置-&gt;Wi-Fi。。。。。。)

命令行中输入: adb connect 192.168.0.142:5555

如果返回"connected to 192.168.0.142:5555",恭喜你,现在可以拔掉USB线,然后,在SDK中就可以无线安装APK以及看LOGCAT的信息啦。

如果要退出无线模式,输入adb usb.