diff --git a/README.md b/README.md index ef217c9..c6e1b57 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repository contains a reference implementation for controlling an Android e The agent operates in a continuous loop: 1. It captures a screenshot of the virtual device using ADB. 2. It sends the screenshot along with the user's task to Gemini 3.5 Flash. -3. The model returns structured tool commands (such as `click`, `type`, `long_press`, `drag_and_drop`, `press_key`, `go_back`, `wait`, `list_apps`, `open_app`, `take_screenshot`). +3. The model returns structured tool commands (such as `click`, `type`, `long_press`, `drag_and_drop`, `press_key`, `go_back`, gwait`, `list_apps`, `open_app`, `take_screenshot`). 4. The client executing script maps the normalized coordinates (0-999) to the actual physical resolution of the screen and executes the action via ADB. 5. The loop repeats until the task is complete. @@ -16,7 +16,6 @@ The agent operates in a continuous loop: * `agent.py`: The main agent script orchestrating the interaction loop. * `setup_emulator.sh`: Idempotent shell script to configure and create the Android virtual device (`AI_Agent_Phone`) on macOS. * `requirements.txt`: Python package dependencies. -* `run.sh`: Convenient entrypoint script to create virtualenv, install dependencies, and run the agent. ## Setup Instructions @@ -45,22 +44,25 @@ export GEMINI_API_KEY="your-api-key-here" ### 3. Run the Agent -You can launch the agent by executing `run.sh`: +Create a virtual environment and install the required dependencies: ```bash -chmod +x run.sh -./run.sh +uv venv +source .venv/bin/activate +uv pip install -r requirements.txt ``` -By default, the script runs the task: *"Find the latest blog post from philipp schmid and summarize it."* -Alternatively, you can run the agent manually: +Then run the agent: ```bash -python agent.py "Open Settings and enable dark mode" +python agent.py "Find the latest blog post from philipp schmid and summarize it." ``` ---- +Alternatively, you can run the agent with a custom task: +```bash +python agent.py "Open Settings and enable dark mode" +``` ## Licensing & Disclaimer diff --git a/run.sh b/run.sh deleted file mode 100755 index 05ad980..0000000 --- a/run.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -cd "$(dirname "$0")" - -if [ -z "${GEMINI_API_KEY:-}" ]; then - echo "[-] Set GEMINI_API_KEY first:" - echo " export GEMINI_API_KEY=\"your-key\"" - exit 1 -fi - -if ! command -v uv &> /dev/null; then - echo "[-] uv is required. Install from https://docs.astral.sh/uv/" - exit 1 -fi - -if [ ! -d ".venv" ]; then - echo "[+] Creating virtual environment..." - uv venv -fi - -uv pip install -q -r requirements.txt - -echo "[+] Running agent: Find the latest blog post from philipp schmid and summarize it." -uv run python agent.py "Find the latest blog post from philipp schmid and summarize it."