Swind / pure-python-adb

This is pure-python implementation of the ADB client.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle multiple devices with same serial number

BobrG opened this issue · comments

Hi! I am trying to work with two phones simultaneously but they have equal serial numbers. However their transport id or usb-ports differ. When I try to connect to this devices with serial number with the following code I obviously obtain an error:

os.system('adb start-server')
client = AdbClient(host="127.0.0.1", port=5037)
device = client.device("0123456789ABCDEF")
device.shell("echo hello world !")

RuntimeError: ERROR: 'FAIL' 0014more than one device

I know that in bash I can specify a particular device with transport id, but I do not understand how to do this in Python. Can you help me deal with this issue?