I need to control an android app using a python script. Currently, I connect my phone to my laptop and use adb (android debug bridge).
Process:
1. Laptop sends an adb shell command to android to take a snapshot of the screen
2. Android sends the snapshot to my laptop for processing
3. Python/laptop will process the snapshot by analyzing a series of pixels to detect a change in shapes on screen and decide what action to take (tap, swipe, ...)
4. Python/laptop will send an adb shell tap or swipe command to the android device
5. Android will execute the action
The problem is that this process is a little slow and it binds my phone to my laptop.
Is there a way to have the python script live on the android device directly making decisions and taking actions? The closest I have found so far is using Termux, but what library could I use to replace adb? (To analyse the content of the screen, send tap/swipe actions?)
Asked by willer2k
(111 rep)
Nov 19, 2021, 08:09 PM