How zai-org/open-autoglm works
Open-AutoGLM is a multimodal phone-agent framework: a user gives a natural-language task, the agent pairs a screen image with task context, requests a model response, parses an action, and executes it on a selected phone backend until completion. The documented product supports Android/ADB, HarmonyOS/HDC, and iOS/WebDriverAgent, plus sensitive-action confirmation and human takeover. The graph reflects those documented capabilities; unsampled implementation details are represented only where paths are supported, and unsupported internal call links are omitted.
Main entry points: agent_ios.py iOS agent loop · agent.py Android agent loop · adb/device.py ADB device operations · hdc/device.py HDC device operations
Components 29
Agent workflow
- CLI entry
main.py - Android agent loop
phone_agent/agent.py - iOS agent loop
phone_agent/agent_ios.py - Android action handler
phone_agent/actions/handler.py - iOS action handler
phone_agent/actions/handler_ios.py
Device control
- Android backend selector
phone_agent/device_factory.py - ADB device operations
phone_agent/adb/device.py - ADB connection
phone_agent/adb/connection.py - ADB input
phone_agent/adb/input.py - ADB screenshots
phone_agent/adb/screenshot.py - HDC device operations
phone_agent/hdc/device.py - HDC connection
phone_agent/hdc/connection.py - HDC input
phone_agent/hdc/input.py - HDC screenshots
phone_agent/hdc/screenshot.py
Model and configuration
- Model API client
phone_agent/model/client.py - Agent prompts
phone_agent/config/prompts.py - Prompt localization
phone_agent/config/i18n.py - Operation timing
phone_agent/config/timing.py - Android app mappings
phone_agent/config/apps.py - HarmonyOS app mappings
phone_agent/config/apps_harmonyos.py
iOS control
- iOS app mappings
phone_agent/config/apps_ios.py - WebDriverAgent connection
phone_agent/xctest/connection.py - iOS device operations
phone_agent/xctest/device.py - iOS input
phone_agent/xctest/input.py - iOS screenshots
phone_agent/xctest/screenshot.py
Other components
- Task requester
- Android or HarmonyOS phone
- iPhone
- OpenAI-compatible model service
Connections 27
- Task requester → CLI entry: submits task
README.md - CLI entry → Android agent loop: starts agent
main.py - CLI entry → iOS agent loop: starts iOS agent
main.py - Android agent loop → Model API client: requests inference
phone_agent/agent.py - Android agent loop → Android action handler: executes action
phone_agent/agent.py - iOS agent loop → Model API client: requests inference
phone_agent/agent_ios.py - iOS agent loop → iOS action handler: executes action
phone_agent/agent_ios.py - Android action handler → Android backend selector: dispatches controls
phone_agent/actions/handler.py - Android backend selector → ADB device operations: selects backend
phone_agent/device_factory.py - Android backend selector → HDC device operations: selects backend
phone_agent/device_factory.py - ADB device operations → Android or HarmonyOS phone: controls
README.md - HDC device operations → Android or HarmonyOS phone: controls
README.md - iOS agent loop → WebDriverAgent connection: creates session
phone_agent/agent_ios.py - iOS action handler → iOS device operations: performs actions
phone_agent/actions/handler_ios.py - iOS device operations → iPhone: controls
README.md - iOS agent loop → iOS screenshots: captures screen
- Android agent loop → ADB screenshots: captures screen
- Model API client → OpenAI-compatible model service: sends requests
phone_agent/model/client.py - Model API client → Prompt localization: uses translations
phone_agent/model/client.py - ADB connection → Operation timing: uses delays
phone_agent/adb/connection.py - HDC connection → Operation timing: uses delays
phone_agent/hdc/connection.py - ADB device operations → Android app mappings: resolves app names
phone_agent/adb/device.py - HDC device operations → HarmonyOS app mappings: resolves app names
phone_agent/hdc/device.py - iOS device operations → iOS app mappings: resolves bundle IDs
phone_agent/xctest/device.py - iOS action handler → iOS input: types text
phone_agent/actions/handler_ios.py - ADB device operations → ADB connection: uses connection
phone_agent/adb/device.py - HDC device operations → HDC connection: uses connection
phone_agent/hdc/device.py