An AI agent runtime for Android that controls your device through accessibility services or root access. Think OpenClaw, but for Android.
- ✅ Accessibility-based automation (no root required)
- ✅ Root enhancement (optional, for advanced control)
- ✅ Tool system (tap, swipe, type, screenshot, shell commands)
- ✅ LLM integration (local or remote)
- ✅ Jetpack Compose UI (modern Android UI)
- ✅ Standalone app (no PC required)
┌─────────────────────────────────────┐
│ Android App (Kotlin) │
├─────────────────────────────────────┤
│ UI Layer (Jetpack Compose) │
│ - Chat interface │
│ - Settings & permissions │
├─────────────────────────────────────┤
│ Agent Core │
│ - Session management │
│ - Tool execution engine │
│ - Memory system │
│ - LLM integration │
├─────────────────────────────────────┤
│ Control Layer │
│ ├─ Accessibility Service │
│ │ - View hierarchy parsing │
│ │ - Gesture injection │
│ ├─ Root Module (optional) │
│ │ - Shell command execution │
│ └─ Device APIs │
│ - Sensors, camera, files │
├─────────────────────────────────────┤
│ Tool System │
│ - tap, swipe, type_text │
│ - screenshot (hierarchy) │
│ - shell (with optional root) │
└─────────────────────────────────────┘
- Android 12 (API 31) or higher (updated for Gemini Nano support)
- Optional: Rooted device for advanced features
- Go to Releases
- Download the latest
app-debug.apk - Install on your device
- Enable Accessibility Service in Settings
git clone https://github.com/YOUR_USERNAME/android-agent.git
cd android-agent
./gradlew assembleDebug
# APK will be in app/build/outputs/apk/debug/app-debug.apk-
Enable Accessibility Service
- Open the app
- Tap "Enable Accessibility"
- Navigate to Settings → Accessibility → Android Agent
- Toggle ON
-
Configure LLM Endpoint (optional)
- Open app settings
- Enter your LLM API endpoint (Ollama, OpenAI-compatible, etc.)
- Example:
http://192.168.1.100:11434/v1/chat/completions
-
Start using!
- Type commands in the chat
- The agent will use tools to control your device
| Tool | Description | Parameters |
|---|---|---|
tap |
Tap at coordinates | x, y, duration |
swipe |
Swipe gesture | startX, startY, endX, endY, duration |
type_text |
Type into focused field | text |
screenshot |
Get UI hierarchy as JSON | - |
shell |
Execute shell command | command, useRoot |
find_element |
Find UI element by text/ID | text, description, resourceId |
launch_app |
Launch app by name or package | appName, packageName |
navigate |
System navigation (back/home) | action |
get_current_app |
Get active app info | - |
scroll |
Scroll up/down/left/right | direction, elementText |
clipboard |
Get/set clipboard content | action, text |
notifications |
Open/close notification shade | action |
long_press |
Long press at coordinates | x, y, duration |
wait |
Wait for duration or element | seconds, forText, timeout |
click_element |
Find and click element by text | text, index |
Run Ollama on your Android device via Termux:
# In Termux
pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu
# Then install Ollama in Ubuntu
curl -fsSL https://ollama.com/install.sh | sh
ollama servePoint the app to: http://localhost:11434/v1/chat/completions
Run Ollama, LM Studio, or any OpenAI-compatible server on your network:
# On your desktop
ollama servePoint the app to: http://YOUR_COMPUTER_IP:11434/v1/chat/completions
Any OpenAI-compatible endpoint works:
- OpenRouter:
https://openrouter.ai/api/v1/chat/completions - OpenAI:
https://api.openai.com/v1/chat/completions
| Permission | Purpose | Required |
|---|---|---|
INTERNET |
LLM API calls | Yes |
ACCESSIBILITY_SERVICE |
Device control | Yes |
FOREGROUND_SERVICE |
Background operation | Yes |
ACCESS_SUPERUSER |
Root commands | No |
./gradlew assembleDebug # Debug APK
./gradlew assembleRelease # Release APK (requires signing)
./gradlew test # Run testsThe project includes a CI workflow that automatically:
- Builds APK on every push
- Uploads artifacts (30-day retention)
- Creates GitHub releases on tags
To create a release:
git tag v0.1.0
git push origin v0.1.0
# GitHub Actions will build and attach APK to the releaseandroid-agent/
├── .github/workflows/ # CI/CD workflows
├── app/
│ ├── src/main/
│ │ ├── kotlin/
│ │ │ ├── core/ # Agent runtime
│ │ │ ├── services/ # Accessibility & background
│ │ │ ├── tools/ # Tool implementations
│ │ │ ├── ui/ # Jetpack Compose UI
│ │ │ └── models/ # Data models
│ │ ├── res/ # Resources
│ │ └── AndroidManifest.xml
│ └── build.gradle.kts
├── docs/ # Documentation
└── README.md
- Basic Android app scaffold
- Agent loop (prompt → tools → response)
- Chat UI
- GitHub Actions CI
- Accessibility Service implementation
- Screen content extraction
- Gesture injection (tap, swipe, type)
- Element finder (by text, ID, coordinates)
- Screenshot capture (hierarchy-based, pixel WIP)
- Root detection
- Shell execution via
su - Direct input injection (
/dev/input/event*) - Advanced automation (install APKs, modify settings)
- App launcher & control
- Navigation (back, home, recents)
- Current app detection
- Browser automation
- Notification reader/responder
- Camera & sensor access
- File manager
- Contacts & calendar integration
- Persistent memory (Room DB)
- Session management
- Skill installation system
- User preferences
- Multi-agent orchestration
- Voice input/output
- OCR for visual understanding
- Image recognition (ML Kit)
- Task scheduling
- Local-first: Works offline with local LLM
- Transparent: All tool calls logged and visible
- Sandboxed: Accessibility API is safer than raw root
- Open source: Audit the code yourself
Pull requests welcome! Areas needing help:
- Additional tools (calendar, contacts, camera)
- LLM integration improvements
- UI/UX enhancements
- Testing & documentation
MIT License - see LICENSE
- Inspired by OpenClaw
- Built with Jetpack Compose
- Uses libsuperuser for root access
Warning: This is experimental software. Use at your own risk. The accessibility service has broad permissions — only install from trusted sources.