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.