Nowadays, we often use USB to connect to our device to test our programs. But how about wireless test? It may be more convenient.
The default debug mode in Android is USB debug. We can do some small changes so that we can debug wirelessly. Let’s do it step by step.
- Your should root your device.
- Install a SSH app on your device. What I use is ssh/sftp daemon, which is free in Google Play. After running the ssh server on your phone, you can use ssh to log in your device through Wifi.
- Use command “ps” to check whether /sbin/adbd/ is running. If it’s running, you can stop it with “stop adbd”.
- Execute command “setprop service.adb.tcp.port 5555”. Set the running mode of adbd to TCP. And listening port is 5555.
- Run adbd by “start adbd”.
- Execute command “netstat”. You can see port 5555 is in states “Listen”.
- Go back to your computer. Use command “adb connect IP:5555”. The IP is your device’s IP. If the connection is successful, you can see a message “connected to IP:5555”.
- Use “adb devices” to check whether it is connected successfully.
All work is done. Now you can enjoy your wireless debugging!