Last active
February 21, 2023 14:09
-
-
Save keuv-grvl/82227107b95e861bbe063a6cbd111d4a to your computer and use it in GitHub Desktop.
Capture android screen from Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%pip install pure-python-adb imageio | |
from ppadb.client import Client as AdbClient | |
# plug your android device with USB debugging | |
client = AdbClient(host="127.0.0.1", port=5037) | |
device = client.devices()[0] | |
screencap = device.screencap() | |
import imageio as iio | |
np_img = iio.imread(bytes(screencap)) | |
np_img.shape # (2400, 1080, 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment