Sendevent - Android with Cython
Project description
Solution for UiAutomator's "Could not detect idle state" Cpulimit/Cython
pip install cythonuiautomatorstruct
Tested against Windows 10 / Python 3.11 / Anaconda / ADB / Bluestacks 5
Important!
The module will be compiled when you import it for the first time. Cython and a C++ compiler must be installed!
from cythonuiautomatorstruct import yield_uiautomator_dump, pretty_print_struct_array
import shutil
adb_path = shutil.which("adb")
device_serial = "127.0.0.1:5560"
for r in yield_uiautomator_dump(
shell_exe=[adb_path, "-s", device_serial, "shell"],
appname="com.kiwibrowser.browser",
pid=-1,
cpu_limit=10,
include_children=True,
lazy=True,
dump_timeout=10,
nice_level="-20", # max priority for uiautomator
outfile="/sdcard/window_dump.xml",
use_cpulimit=True,
run_as_shell=True,
debug=True,
su_prefix_for_input="su -c '",
su_sufix_for_input="'",
cpulimit_path="/data/data/com.termux/files/usr/bin/cpulimit", # https://github.com/opsengine/cpulimit, limits the cpu usage of the target process
su_prefix_for_cpulimit="su -c '",
su_suffix_for_cpulimit="'",
):
pretty_print_struct_array(r)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cythonuiautomatorstruct-0.10.tar.gz
.
File metadata
- Download URL: cythonuiautomatorstruct-0.10.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb7ea44481d08a91891c9a70f16b9d68d04af17e16d19666213378807abffae8 |
|
MD5 | 121360a97cdbea65e4a9a9229eb506bc |
|
BLAKE2b-256 | 43077cab00a4d0b629e86dd8d65839b0c0a1200c989285df0d8e32825e0f3bbc |
File details
Details for the file cythonuiautomatorstruct-0.10-py3-none-any.whl
.
File metadata
- Download URL: cythonuiautomatorstruct-0.10-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 695eb2dd0df0c1ecff5114f1ff8e1723f677abcf5c2c5258b4c7969049081b5d |
|
MD5 | a76bd05fe6ce58d0bccb20a3e6a14268 |
|
BLAKE2b-256 | a8d908f91141329653ec8173bf47b4d34de7d24326d7dfbff83deb4c6a87c537 |