Skip to main content

uiautomator parser for Android

Project description

uiautomator parser for Android

Tested against Bluestacks 5 / Python 3.11, directly in the terminal

pip install cyuiautomatordump

Cython and a C compiler must be installed!

You also need to compile https://github.com/opsengine/cpulimit

Gets a UI Automator dump, processes it, and returns the result as a DataFrame.

Parameters:
package (str): The package name.
memdisk_path (str): The path to the memory disk.
memdisk_size (int): The size of the memory disk in MB.
memdisk_su (str): The superuser command.
memdisk_sh (str): The shell command.
memdisk_try_all_rw_remount_combinations (bool): Whether to try all read-write remount combinations.
max_cpu_percentage_for_process (int): The maximum CPU usage percentage for the process.
sleep_after_starting_cpu_limiter (float): The sleep time after starting the CPU limiter.
add_screenshot (bool): Whether to add a screenshot to the DataFrame.
screen_width (int): The width of the screen.
screen_height (int): The height of the screen.
debug (bool): Whether to enable debug mode.
uiautomator_nice (int): The nice value for UI Automator.
uiautomator_sleep_between_retries (float): The sleep time between retries for UI Automator.
uiautomator_shell (bool): Whether to use the shell in the subprocess.
uiautomator_timeout (int): The timeout for UI Automator.

Yields:
pd.DataFrame: The processed UI Automator dump as a DataFrame.

from cytonuiautomatordump import get_cyuiautomator_dump



geni = get_cyuiautomator_dump(
    package= "com.instagram.android",
    memdisk_path="/media/ramdisk",
    memdisk_size=256,
    memdisk_su="su",
    memdisk_sh="sh",
    memdisk_try_all_rw_remount_combinations=False,
    max_cpu_percentage_for_process=10,
    sleep_after_starting_cpu_limiter=0.5,
    add_screenshot=False,
    screen_width=720,
    screen_height=1280,
    debug=False,
    uiautomator_nice=-19,
    uiautomator_sleep_between_retries=0.3,
    uiautomator_shell=True,
    uiautomator_timeout=20,
)
counter = 0
while True:
    df = next(geni)
    print(df)
    counter = counter + 1
    print(counter)

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cytonuiautomatordump-0.10.tar.gz (26.8 kB view hashes)

Uploaded Source

Built Distribution

cytonuiautomatordump-0.10-py3-none-any.whl (27.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page