Sunless
Sunless

Reputation: 1

Screenshot on Android using KTXPY or QPYTHON

I am using ktxpy (prefered) or qpython.

I want to read data from screen, using tesseract or other.

For this I would like to take a screenshot using any library that I can install through pip for ktxpy.

Which libraries allow me to do this in android? I tested a few that work in Windows but due how android OS works I already knew they wouldn't work for this specific task.

It can be just a combination of keys that allows to replicate pressing screenshot button.

Any other bypass to make this work in a simple way is welcomed.

Upvotes: 0

Views: 137

Answers (1)

Sunless
Sunless

Reputation: 1

I solved the issue in python in my computer by doing a combination of:

adb exec-out screencap -p

adb shell input tap x y

Notes:

  1. for adb shell input tap I needed extra permissions on my phone - I was able to get them on settings on my xiaomi android 10 developer options, this may vary on phone. No root required.
  2. From here I can use tesseract on python to analyze the screenshot and do whatever I want.
  3. I didn't use ktxpy or qpython sadly, because I do it directly on my PC, I suppose with android 10+ I can use wifi adb and maybe do something different.

Upvotes: 0

Related Questions