pure-python-adb icon indicating copy to clipboard operation
pure-python-adb copied to clipboard

python-adb freezes when connecting to bluestacks app player

Open sunnad99 opened this issue 3 years ago • 2 comments

When I try to launch the following script for Bluestacks 10's app player, my interpreter just freezes. The freeze occurs whenever I call a method of the Client class (devices, version etc...)

from ppadb import client


adb = client.Client(host='127.0.0.1', port=5555)
print(adb.devices())

There is no error that is thrown and I cannot even keyboard interrupt the interpreter. I have to force close it from task manager.

sunnad99 avatar Jun 12 '22 20:06 sunnad99

You are interpreting the interface incorrectly.

The first API call is to connect ppadb client with the adb server on your host. The port number is therefore 5037

That instance you can use to do the adb.devices() call

Once you have that connection, then you have to perform the step to connect to a device by creating a device instance

Client.device() Or Client.remote_connect(<ip_address>, 5555)

That instance is the one you use to do the adb.shell() call

On Sun, Jun 12, 2022 at 13:30 Sulaiman Nadeem @.***> wrote:

When I try to launch the following script for Bluestacks 10's app player, my interpreter just freezes.

from ppadb import client

adb = client.Client(host='127.0.0.1', port=5555) #Stops on one of these two lines print(adb.devices())

There is no error that is thrown and I cannot even keyboard interrupt the interpreter. I have to force close it from task manager.

— Reply to this email directly, view it on GitHub https://github.com/Swind/pure-python-adb/issues/95, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANCQ4ZNYDTENAKHGGIRZQETVOZCGBANCNFSM5YSIOX2A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Edwin Bisek Principal Developer, Automation and Tools Video Collaboration 510 299 0115

ebisek-logi avatar Jun 13 '22 02:06 ebisek-logi

Ahh Alright, I understand now, that makes sense. So to connect ppadb to my device, I do need to have adb running. I assumed this library would not require adb from the android website but now its pretty clear. Thank you for the swift response!

sunnad99 avatar Jun 13 '22 14:06 sunnad99