您的位置:首页 > 其它

无数据线 debug

2015-10-19 18:07 190 查看
当你没有数据线的时候也想debug,怎么办?还有就是测试串口的时候,那个插口要被占用,无法跟电脑保持adb连接,怎么办?

话不多说。官方文档


Debugging considerations

When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an 
adb
 connection to the Android-powered device via
USB. You can still access 
adb
 over a network connection. To enable 
adb
 over a network connection:
Connect the Android-powered device via USB to your computer.
From your SDK 
platform-tools/
 directory, enter 
adb tcpip 5555
 at the command prompt.
Enter 
adb connect <device-ip-address>:5555
 You should now be connected to the Android-powered device and can issue the usual 
adb
 commands like 
adb logcat
.
To set your device to listen on USB, enter 
adb usb
.

具体如下
1:借根数据线连上手机和电脑

2:打开终端cmd,cd到sdk里的platform-tools/目录,输入adb tcpip 5555

3:查看手机ip,然后输入adb connect 手机ip : 5555

4:完成,还线
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息