1. Let android phone listening on the specified port:
This step requires the use of shell, and therefore have a terminal emulator on the phone, but the line a lot, just find on the list, followed by typing the following lines:
1 |
su //获取root权限 |
2 |
setprop service.adb.tcp.port 5555 //设置监听的端口,端口可以自定义,如5554,5555是默认的 |
3 |
stop adbd //关闭adbd |
4 |
start adbd //重新启动adbd |
2. Connect your phone and make sure wifi ip address, phone and computer connected to the same network, write down the phone, assuming abcd
3. Open a command prompt on your computer, type the following command:
1 |
adb connect a.b.c.d //如果不输入端口号,默认是5555,自定义的端口号必须写明,对应第1步中自定义的端口号,例如:a.b.c.d:5554 |
4. Configure the success, the command line shows: "connected to abcd", then you can debug the program, ^ _ ^.
To turn off wifi debugging is also very simple, just need the port number is set to -1, and the first step can be repeated.
Reproduced in: https: //my.oschina.net/lendylongli/blog/226810