Vision-first grounding
The planner reasons from the current screenshot instead of requiring an accessibility tree, enabling interaction with text, icons, and visually defined controls.
PhoneAgent combines vision-language planning, deterministic Android capabilities, safe structured actions, post-action evidence, and bounded recovery into one auditable loop for real devices.
Open Settings and find Battery.
Inspired by Open-AutoGLM and recommended with Zhipu BigModel's autoglm-phone API.
PhoneAgent keeps each layer inspectable: observation, model planning, action parsing, Android execution, evidence verification, recovery, and trajectory persistence.
The planner reasons from the current screenshot instead of requiring an accessibility tree, enabling interaction with text, icons, and visually defined controls.
Model output is parsed through AST/JSON and validated against an action allow-list. Generated text is never executed as Python code.
do(action="Tap", element=[512, 438])
Discover Launcher activities, resolve aliases, and prefer package/activity launch before falling back to visual navigation.
Separate command success, observable UI change, and deterministic semantic evidence instead of collapsing them into one success flag.
Failure episodes have explicit budgets. Non-idempotent actions such as Tap, Type, Swipe, and Back are never blindly replayed.
Persist observations, model responses, actions, execution evidence, verification, recovery decisions, state transitions, and final results.
PhoneAgent does not force every operation through a vision model. It combines Android system capabilities with a visual planning loop, then records evidence at each boundary.
Fast pathResolve and launch installed applications through package/activity state.
General pathUse the screenshot and task context to plan navigation inside an application.
Evidence pathVerify observable or deterministic effects before continuing or recovering.
No frontend build step, no workflow framework, and no device-specific accessibility tree required.
Linux, Python 3.12+, Android Platform Tools, and an Android device with USB debugging enabled.
Use a vision-language model service compatible with the OpenAI Chat Completions API.
Start with deterministic application launch, then move to multi-step visual tasks.
# Clone and install
$ git clone https://github.com/AuroraEchos/PhoneAgent.git
$ cd PhoneAgent
$ uv sync --extra dev
# Configure the VLM endpoint
$ cp .env.example .env
# Check the device and run
$ adb devices
$ uv run phoneagent "打开设置"
{
"type": "verification",
"step": 4,
"action": {
"name": "Launch",
"app": "设置"
},
"result": {
"command_success": true,
"observable_effect_verified": true,
"semantic_effect_verified": true,
"policy": "foreground_package_match"
}
}
A run is not just terminal output. PhoneAgent records the state machine, model interaction, structured action, execution result, verification evidence, recovery policy, and final outcome.
The first release freezes a reliable baseline. Future work can improve semantic correctness without obscuring the core loop.
Vision agent loopObserve, plan, execute, verify, recover.
Android app resolverDiscovery, aliases, package launch.
Safe action runtimeValidation, confirmation, bounded recovery.
Semantic verificationSubgoal-aware evidence and independent review.
Evaluation harnessTask suites, replay, metrics, and regression.
Provider abstractionMore local and hosted VLM backends.
On-device runtimeAccessibility, MediaProjection, privacy controls.
Experience learningReusable app knowledge from trajectories.
Hybrid perceptionVision plus system UI signals where available.
PhoneAgent is an Alpha research and engineering runtime. It exposes uncertainty instead of converting weak evidence into confident claims.
For coordinate actions, a changed screen does not prove that the intended UI target was selected.
The planner currently reports full completion through finish(...); there is no independent task judge yet.
DRM, FLAG_SECURE, passwords, verification codes, and payment flows may be unobservable or sensitive.
A true on-device product requires an Android application, services, permissions, and privacy controls.
Read the code, reproduce the loop, inspect the trajectory, and help improve reliable mobile interaction.