how can I print ADB devices list?

Viewed 328

I'm a total beginner and I struggle to acces to the ADB devices list and print it.

here is my starting code:

import ppadb

from ppadb.client import Client

adb = Client(host='localhost', port=5037)
devices = adb.devices()

This code succeed to find all the ABD devices connect to my computer. Unfortunately, when i type this

print (devices)

the console return

[<ppadb.device.Device object at 0x00000139C6FC8F40>]

How can I manage to have acces to a usable list ?

thanks in advance for your help

1 Answers

What you need is to loop through the Device objects and return the serial

for device in devices:
    print (device.serial)

this roughly corresponds to the outcome of adb devices.

Related