Swind/pure-python-adb

Cannot connect to the device even if using command line I can

jenniejj opened this issue · 2 comments

While using this:

from ppadb.client import Client as AdbClient
# Default is "127.0.0.1" and 5037
client = AdbClient(host="192.168.1.10", port=5555)
device = client.device("myphonename")
device.shell("echo hello world !")

I can never get it connected, it just hangs.

If I try to do the same and connect by following
adb kill-server
adb USB
adb tcpip 5555
unplug/plug USB cable
connect 192.168.1.10:5555

I get Connected to 192.168.1.10:5555

and I can also see it connected by using adb devices

What is wrong and how can I debug this?

I have the problem too.
ADB in comandline work well. But I cannot connect in python.
Windows + Bluestacks

@jenniejj

If you have connected your device via USB, do this:

from ppadb.client import Client as AdbClient #Default is "127.0.0.1" and 5037 client = AdbClient(host="127.0.0.1", port=5037) # or just do client = AdbClient() if you want to leave default as is. device = client.device("<your-device-dsn>") device.shell("echo hello world !")

If you have connected wireless:
from ppadb.client import Client as AdbClient #Default is "127.0.0.1" and 5037 client = AdbClient(host="127.0.0.1", port=5037) #or just do client = AdbClient() if you want to leave default as is. device = client.device("<your-ip-address>") # 192.168.1.10:5555 device.shell("echo hello world !")