码迷,mamicode.com
首页 > 移动开发 > 详细

Android Quick Tip - ADB over WiFi

时间:2016-05-30 06:32:07      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

http://stuffandtech.blogspot.jp/2012/03/android-quick-tip-adb-over-wifi.html

 

 
MAR
26

Android Quick Tip - ADB over WiFi

Someone I had the pleasure of working with recently showed me something extremely cool for Android development. It is simply that it is possible to use the ADB (Android Debug Bridge) over TCP/IP or more practically speaking over WiFi. This means that you don‘t have to tether you‘r Android device(s) to you‘r computer when you are developing, you can just connect it to a charger or someone elses computer. This is quite handy if you have more Android devices then USB ports and very very handy if you are working with multiple people on the same LAN that are testing you‘r latest builds. Here is a quick tutorial (requires Android SDK and ADB installed):

Step 1.
Connect you‘r Android device to you‘r computer and have USB debugging enabled. Also you have to have added the Android tools to you‘r path or else you have to go to the SDK folder first. Open up you‘r terminal/cmd and type:
adb tcpip 5555
This should give the output:
restarting in TCP mode port: 5555

You have now enabled ADB over TCP/IP using the port 5555 (use another port if that one is taken)

Step 2.
Now knowing the IP of you‘r Android device (Settings->About->Status) type the following into the terminal:
adb connect <you‘r devices IP adress>
you should now get the output:
connected to <you‘r devices IP adress>
Step 3.
You should now be able to debug against you‘r device as usual as long as it is connected to the same WiFi as you‘r computer. A simple test:
adb devices
Should give the output:
List of devices attached:
<you‘r devices IP adress>    device
Or something similar. Go ahead and try to read the Logcat using DDMS or simply deploying to you‘r device using you‘r favourite IDE IntelliJ IDEA. I have tested the following to work over WiFi ADB:

  • Logcat output
  • Deploy dev app
  • Debug dev app
  • Screenshots over ADB
I have been using my Nexus S so this may not work on all Android devices, but do give it a try and post here if you are sucessfull (with the name of you‘r device). A huge thanks to Håvard for showing me this!

Update
Sorry for not checking the comments here, a minor typo is probably causing problems as the first line was with 555 and then the following are with 5555, fixed now, sorry guys.

Android Quick Tip - ADB over WiFi

标签:

原文地址:http://www.cnblogs.com/donaldlee2008/p/5541017.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!