Closed benjoromo closed 2 years ago
You need reconnect=True
if you are taking multiple screenshots.
Or you can use something like https://github.com/dtmilano/AndroidViewClient/blob/master/examples/helper/screenshot.py
The reconnect=true worked great on all devices. Thank you for the program and your help.
I am hoping to have a number of android devices all controlled by the same PC. I will take semi regular screenshots, analyze them, and send appropriate mouse clicks and text to control the devices. I have been using AdbClient. Does ViewClient allow sending text and mouse clicks as well? Can I use AdbClient along side ViewClient? What is the most efficient way to do this?
Yes you can connect multiple devices, take screenshots and send and get text. ViewClient
and AdbClient
is one possible combination but there are more, like ViewClient
and CulebraTester2-public which is a more powerful backend. Some special cases, for example when you need to take screenshots at a very fast rate, you can even bypass ViewClient
and invoke CulebraTester2-public
directly.
Don't hesitate to ask any further question here or at stackoverflow#androidviewclient.
I create a device and use the device to take a snapshot successfully. The subsequent times I attempt to take a snapshot it fails with the following.
File "/home/uandme/venv/lib/python3.8/site-packages/com/dtmilano/android/adb/adbclient.py", line 850, in takeSnapshot self.send('framebuffer:', checkok=True, reconnect=False) File "/home/uandme/venv/lib/python3.8/site-packages/com/dtmilano/android/adb/adbclient.py", line 311, in send self.checkOk() File "/home/uandme/venv/lib/python3.8/site-packages/com/dtmilano/android/adb/adbclient.py", line 375, in checkOk raise RuntimeError("ERROR: %s %s" % (repr(recv), error)) RuntimeError: ERROR: b'' b''
It appears to work on an old Android version 4.4.4. It fails on Android 7.0 and Android 11. Any thoughts on what is causing this problem?
Thanks, Ben.