Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b00ca92
Add ui_device drag
dtmilano Feb 24, 2024
07834c1
Bump
dtmilano Feb 24, 2024
4a8d868
Upgrade actions checkout and setup-python
dtmilano Feb 24, 2024
7beb29f
Bump
dtmilano Feb 24, 2024
83c36d9
Update culebratester client dependency
dtmilano Feb 24, 2024
e4b6174
Bump
dtmilano Feb 24, 2024
e381876
Added documentation to functions
gchai Feb 27, 2024
7bea75d
Add 2 million download to README
dtmilano Feb 27, 2024
e8eae4b
Center image in README
dtmilano Feb 27, 2024
8a1994a
Add launcher drag example
dtmilano Feb 27, 2024
5396879
Merge pull request #325 from gchai/master
dtmilano Feb 27, 2024
fde8970
Update README.md
dtmilano Mar 3, 2024
41699df
Add display physical size and dp
dtmilano Apr 3, 2024
fdf0f9f
Bump
dtmilano Apr 3, 2024
1c0a0f4
Improve example
dtmilano Apr 3, 2024
ee36199
Fix gfxinfo field numbers
dtmilano Apr 30, 2024
8738d3a
Bump
dtmilano Apr 30, 2024
cf491c7
add 'r' in front of some regex strings.
giantpune Sep 19, 2024
5a6fa78
Merge pull request #329 from giantpune/python_3.21_regex_fix
dtmilano Sep 27, 2024
d6e6cf4
Bump
dtmilano Sep 27, 2024
0a26ede
Replace deprecated ANTIALIAS algorithm
dtmilano Sep 28, 2024
a6f1fa4
Fix escaping for python 3.12
dtmilano Sep 28, 2024
29befc6
Bump
dtmilano Sep 28, 2024
5edf403
Add ui object get child and get from parent
dtmilano Oct 13, 2024
9be41ba
Bump
dtmilano Oct 13, 2024
34d2599
refactor: use `search` instead of `match`
jrafaaael Oct 20, 2024
2971f5f
Merge pull request #331 from jrafaaael/refactor/use-search-instead-of…
dtmilano Oct 21, 2024
6e6f54b
Add spiral example
dtmilano Nov 30, 2024
b60f4ed
Add MCP server
dtmilano Dec 22, 2025
0d147fb
Merge pull request #334 from dtmilano/mcp
dtmilano Dec 22, 2025
2a16f7f
Revise Culebratester2 setup instructions in README
dtmilano Dec 23, 2025
08c63f3
Update Python publish workflow with permissions
dtmilano Dec 23, 2025
ce23fdf
Update Python package upload workflow triggers and steps
dtmilano Dec 23, 2025
152daa5
Change environment name from 'pypi' to 'release'
dtmilano Dec 23, 2025
c75c684
Format natural language test cases in italics
dtmilano Dec 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ name: Upload Python Package

on:
release:
types: [created]
types: [published,created] # Triggers the workflow when a release is published

jobs:
deploy:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: release # Must match the environment name configured on PyPI (if used)
permissions:
contents: read
id-token: write # Mandatory for OIDC trusted publishing

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py clean sdist bdist_wheel
twine upload dist/*
run: python -m pip install --upgrade pip build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No username or password needed; OIDC handles authentication
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ tmp/

# venv #
########
venv/*
venv*/*

# Kiro #
########
.kiro/
104 changes: 90 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
AndroidViewClient
=================
<a href="#"><img src="https://github.com/dtmilano/AndroidViewClient/wiki/images/culebra-logo-transparent-204x209-rb-border.png" align="left" hspace="0" vspace="6"></a>
**AndroidViewClient** was originally conceived as an extension to [monkeyrunner](http://developer.android.com/tools/help/monkeyrunner_concepts.html) but lately evolved
as a pure python tool that automates or simplifies test script creation.
It is a test framework for Android applications that:
**AndroidViewClient/culebra** was initially conceived as an extension to [monkeyrunner](http://developer.android.com/tools/help/monkeyrunner_concepts.html) but has since evolved
into a versatile pure Python tool.
It streamlines test script creation for Android applications by automating tasks and simplifying interactions. This test framework:
<ul><ul>
<li>Automates driving Android applications</li>
<li>Generates re-usable scripts</li>
<li>Provides view-based <i>device independent</i> UI interaction</li>
<li>Uses 'logical' screen comparison (UI Automator Hierarchy based) over image comparison (Avoiding extraneous
detail issues, such as time or data changes)</li>
<li>Supports running concurrently on multiple devices</li>
<li>Provides simple control for high level operations like language change and activity start</li>
<li>Supports all Android APIs</li>
<li>Is written in python (python 3.6+ support in 20.x.y+)</li>
<li>Automates the navigation of Android applications.</li>
<li>Generates reusable scripts for efficient testing.</li>
<li>Offers device-independent UI interaction based on views.</li>
<li>Utilizes 'logical' screen comparison (UI Automator Hierarchy based) instead of image comparison, avoiding extraneous detail issues like time or data changes.</li>
<li>Supports concurrent operation on multiple devices.</li>
<li>Provides straightforward control for high-level operations such as language change and activity start.</li>
<li>Fully supports all Android APIs.</li>
<li>Written in Python with support for Python 3.6 and above in versions 20.x.y and beyond.</li>
</ul></ul>

**🛎** |A new Kotlin backend is under development to provide more functionality and improve performance.<br>Take a look at [CulebraTester2](https://github.com/dtmilano/CulebraTester2-public) and 20.x.y-series prerelease. |
Expand All @@ -26,9 +25,11 @@ It is a test framework for Android applications that:

**NOTE**: Pypi statistics are broken see [here](https://github.com/aclark4life/vanity/issues/22). The new statistics can be obtained from [BigQuery](https://bigquery.cloud.google.com/queries/culebra-tester).

As of August 2021 we have reached:
As of February 2024 we have reached:

<img src="https://github.com/dtmilano/AndroidViewClient/wiki/images/androidviewclient-culebra-1million.png" alt="culebra 1 million downloads" width="80%" align="center">
<p align="center">
<img src="https://github.com/dtmilano/AndroidViewClient/wiki/images/androidviewclient-culebra-2-million-downloads.png" alt="culebra 2 million downloads" width="80%" align="center">
</p>

Thanks to all who made it possible.

Expand All @@ -38,6 +39,81 @@ pip3 install androidviewclient --upgrade
```
Or check the wiki for more alternatives.

# AI-Powered Testing with MCP

**NEW!** AndroidViewClient now includes a Model Context Protocol (MCP) server that enables AI assistants like Kiro to interact with Android devices through natural language.

## Quick Start with MCP

1. **Install with MCP support:**
```bash
pip3 install androidviewclient --upgrade
```

2. **Start CulebraTester2 on your device:**

Check the details at [How to run CulebraTester2 ?](https://github.com/dtmilano/CulebraTester2-public?tab=readme-ov-file#how-to-run-culebratester2-)


4. **Configure your AI assistant:**

Add to `.kiro/settings/mcp.json` or `~/.kiro/settings/mcp.json`:
```json
{
"mcpServers": {
"culebratester2": {
"command": "culebra-mcp",
"env": {
"CULEBRATESTER2_URL": "http://localhost:9987"
}
}
}
}
```

5. **Start testing with natural language:**
- "_Get the device screen size_"
- "_Launch the Calculator app_"
- "_Find the button with text Submit and click it_"
- "_Take a screenshot_"
- "_Swipe up to scroll_"

## MCP Tools Available

The MCP server provides 20 tools for Android automation:

**Element-based interactions:**
- Find elements by text or resource ID
- Click, long-click, enter text, clear text
- Navigate with back/home buttons
- Launch applications

**Coordinate-based interactions:**
- Click/long-click at coordinates
- Swipe gestures

**Device actions:**
- Wake/sleep device
- Get current app
- Force stop apps
- Take screenshots

## Configuration

For detailed MCP configuration options, see the [MCP Configuration Guide](docs/MCP_CONFIGURATION.md).

Quick reference:
- **User-level config** (kiro-cli): `~/.kiro/settings/mcp.json`
- **Workspace config** (Kiro IDE): `.kiro/settings/mcp.json`
- **Examples:** `examples/mcp_config.json`
- **Usage examples:** `examples/test_calculator_mcp.py`

## Environment Variables

- `CULEBRATESTER2_URL`: Base URL for CulebraTester2 (default: `http://localhost:9987`)
- `CULEBRATESTER2_TIMEOUT`: HTTP timeout in seconds (default: `30`)
- `CULEBRATESTER2_DEBUG`: Enable debug logging (`1`, `true`, or `yes`)

# Want to learn more?

> 🚀 Check [Examples](https://github.com/dtmilano/AndroidViewClient/wiki/Resources#examples) and [Screencasts and videos](https://github.com/dtmilano/AndroidViewClient/wiki/Resources#screencasts-and-videos) page to see it in action.
Expand Down
Loading