简体   繁体   中英

How to check programmatically whether WiFi adb is connected or disconnected in android?

I am using WiFi adb to run apps. I want to know if adb is connected or disconnected in my activity. I don't want to go to the adb app to check if adb connected or disconnected.

Can you suggest some programmatic solution for this task?

You can check the state of port 5555 (or other port you have defined) using netstat . If ADB over Wifi is on, the state of port will be LISTEN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM