How can I determine which devices are available to connect to?
See original GitHub issueIn the example code in the readme, we find the line
device1 = AdbDevice(serial='192.168.0.111:5555', default_timeout_s=9.)
This seems to suggest that in order to use this library to talk to a device, I need to know its IP and port already. Is there a facility in this library to obtain this information? If not, I’d suggest there should be.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Identify Devices on My Network - Lifewire
Open your router's mobile app and look for a tab that lists all the devices connected to your network. It might say Devices...
Read more >How to see all the devices connected to your network
Use your router's online interface Log into your router to see the most up-to-date information about which devices are connected. Most models ...
Read more >How to See Who's On Your Wi-Fi - PCMag
You can open your router's management page by typing its IP address in your browser's address bar. Once there, look for an option...
Read more >3 Ways to See Who Is Connected to Your Wireless Network
1. Open a browser. You can use a web browser to log in to the web interface for your wireless router. You can...
Read more >How Can I See What Devices Are Connected to My Network?
How to Check How Many Devices Are Connected to My WiFi Using Software ... There is software that allows you to view detailed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wrote this package to implement ADB shell functionality over TCP. If someone wants to implement that same functionality over USB, including writing tests with complete coverage, then that would be a welcome contribution. But I have no plans to do that myself.
I am just trying library as well and I was going to ask the same question. Limiting to tcp connection doesn’t sound nice and there should be a way to get a list of connected devices as well.
This is how I make it work:
You can get the ip address of the device from
Settings > About Phone > Status
on your phone. Or as Jeff said you can check your router. Or if you are already connected with usbadb shell ip route | awk '{print $9}''
But having just an ip address of your device won’t be enough. You must enable adb connection over tcp first. For this your device needs to be connected with usb and use following adb command:
adb tcpip [port]
e.g.adb tcpip 5555
AdbDevice(serial='192.168.0.111:5555').connect()
is equal toadb connect 192.168.0.111:5555
So the not recommended (as it uses adb commands directly) way to do it will be