Original: http://www.cnblogs.com/sunzhenxing19860608/archive/2011/07/14/2106492.html
1. First let the Android phone listen to the specified port:
This step requires the use of the shell, so there must be a terminal emulator on the phone, but a lot of online, just look for a line, in turn, typing the following lines:
1234 |
su //获取root权限 setprop service.adb.tcp.port 5555 //设置监听的端口,端口可以自定义,如5554,5555是默认的 stop adbd //关闭adbd start adbd //重新启动adbd |
2. Connect your phone to WiFi and make sure your phone and computer are connected to the same network, and note the IP address of your phone, assuming a.b.c.d
3. Open a command prompt on your computer and start typing the following command:
1 |
adb connect a.b.c.d //如果不输入端口号,默认是5555,自定义的端口号必须写明,对应第1步中自定义的端口号,例如:a.b.c.d:5554 |
4. The configuration succeeds, the command line displays: "Connected to A.b.c.d", then you can debug the program, ^_^.
To turn off WiFi debugging, it is also very simple, just set the port number to-1, and repeat the first step.
Debug Android app via WiFi