uiautomator2
uiautomator for android device
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It fills a clear need for Python-based Android automation. Install it if you need to automate Android UI testing or device interaction from Python; the main prerequisite is having a connected Android device with developer mode enabled.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a connected Android device with Developer options enabled, adb installed and configured, and Android version 4.4 or higher.
- Low install friction with a pure-Python wheel distribution.
- Actively maintained with recent commits and a stable release cycle; supports Python 3.8 through 3.13.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the original license notice.
last release 2026-06-26 (49 days) · last repo commit 2026-08-07 · 8,268 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 553,487 downloads/mo, #6,039 on PyPI
Alternatives
Verify before relying
pip install uiautomator2
import uiautomator2 as u2
d = u2.connect() # Connect to Android device
print(d.info) # Get device information
d.xpath('//*[@text="Settings"]').click() # Click element by XPath- Whether the package handles multiple simultaneous device connections or only one at a time.
- Performance characteristics when interacting with complex UI hierarchies or large numbers of elements.
- Whether network latency between the Python client and device significantly impacts automation speed.
What it is and what it does
uiautomator2 is a Python automation framework for Android devices that bridges the gap between UiAutomator (Android's native testing framework) and Python code. It works by running an HTTP service on the Android device side and communicating with it from Python, exposing device capabilities like UI element selection, app launching, screen interaction, and device state queries through a simple Python API.
The package is primarily used for test automation and app control workflows. You connect to an Android device via adb, then interact with UI elements using XPath queries, UiAutomator selectors, or direct coordinate-based actions. It supports waiting for elements, retrieving text, setting input, taking screenshots, and managing device state (screen on/off, clipboard, etc.). The framework handles the complexity of the underlying UiAutomator protocol, letting you write straightforward Python scripts for mobile testing and automation.
Use it for
- Automated UI testing of Android apps by scripting interactions with UI elements and verifying app behavior.
- Mobile app regression testing in CI/CD pipelines by running test suites against connected devices or emulators.
- Extracting data from Android apps by automating navigation and text retrieval from UI elements.
- End-to-end testing workflows that require coordinating multiple app interactions and state checks.
- Device automation tasks like app installation verification, settings configuration, or repetitive user workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It fills a clear need for Python-based Android automation. Install it if you need to automate Android UI testing or device interaction from Python; the main prerequisite is having a connected Android device with developer mode enabled.
Install
uiautomator2 on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and a stable release cycle; supports Python 3.8 through 3.13. Requires a connected Android device with Developer options enabled and adb access.
Requires a connected Android device with Developer options enabled, adb installed and configured, and Android version 4.4 or higher.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the original license notice.
Quickstart
pip install uiautomator2
import uiautomator2 as u2
d = u2.connect() # Connect to Android device
print(d.info) # Get device information
d.xpath('//*[@text="Settings"]').click() # Click element by XPath
Verify before relying
- Whether the package handles multiple simultaneous device connections or only one at a time.
- Performance characteristics when interacting with complex UI hierarchies or large numbers of elements.
- Whether network latency between the Python client and device significantly impacts automation speed.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesPillowadbutilsclickimportlib-resourceslxmlrequestsretry2 |
| Maintenance | Actively maintained 49 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 553,487 / month, #6,039 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: uiautomator2-3.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “android automation python”
- uiautomator2Automates Android device interactions from Python by exposing…
- uiautomatorPython wrapper for Android's uiautomator testing framework that…
- androidtvremote2A Python library for controlling Android TV devices over the network…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also androidtvremote2 · uiautomator · python-fullykiosk · facebook-wda · adb-shell · robotframework-appiumlibrary · adbutils · pure-python-adb · requestium · mozdevice