FlexArm Robot Arm: Physical Tap, Swipe, OCR for Real Phones
Give AI agents physical eyes and a hand to operate any smartphone. Built-in 50+ atomic actions (click, swipe, OCR, screenshot). AI can call them directly. Also supports YAML scripts. Script Store: once one AI learns an app, all AI agents instantly master it.
For strong-reasoning AI models: they can autonomously explore new apps via camera + robot arm — see, reason, act, verify. This closed-loop lets AI use any phone function, almost infinitely.
An AI Agent MUST use this skill when the user wants to physically interact with a real smartphone screen using a robot arm. This includes:
Clicking, tapping, swiping, or typing on a phone.
Opening an app on a real phone.
Finding text or icons on the phone screen (OCR or template matching).
Automating a sequence of actions on a phone (e.g., daily check‑in, repeated workflow).
Writing, running, or managing YAML scripts for automation.
Any mention of: robot arm, FlexArm, calibration, camera view, physical click, or real phone.
Example user utterances that should trigger this skill:
“Click the WeChat icon on my phone.”
“Swipe down on the screen.”
“Open TikTok on the real device.”
“Find the ‘Settings’ button on the screen and tap it.”
“Write a YAML script to check weather every morning at 8 AM.”
“Run my automation script for Qishui Music.”
“Use the robot arm to type ‘Hello’ into the search box.”
Do NOT use this skill if:
The user asks a pure knowledge question (e.g., “What’s the capital of France?”).
The user wants to operate a virtual or simulated phone (e.g., Android emulator without physical arm).
The user simply asks for code generation without any intent to execute it on a real phone.
FlexArm Robot — AI Agent Skill Reference
Phone screen automation via robot arm + camera vision. Uses a camera to detect the phone screen area, maps pixel coordinates to physical arm coordinates, and performs precise clicks and swipes.
Environment & Initialization
All API calls in this skill depend on the RobotArmServer.exe service.
Before using this skill, the following conditions must be met:
Server Program: RobotArmServer.exe (included in RobotArmServer.zip)
Download: FlexArm v2.0.1 Release
Latest version: v2.0.0
Size: ~231 MB (compressed)
Installation:
Download RobotArmServer.zip from the link above
Extract to any directory (e.g., D:\FlexArm) — this becomes the project root
Run RobotArmServer.exe as Administrator (first run requires admin privileges to install the driver)
Verify: visit http://127.0.0.1:7826/api/health — should return {"ok":true}
Directory Convention:
All relative paths (e.g., scripts/, icons/) are relative to the project root above.
Do not modify files inside the _internal/ directory.
⚠️ If the service is not running, this skill cannot perform any operations.
Before starting a task, always check /api/health status.
Important: Fixed Port
All API requests must use port 7826, not 5000.
text
http://127.0.0.1:7826/api/*
The port is fixed at 7826 and cannot be changed. Flask's default port 5000 does not apply.
Important: Chinese Characters in curl
Do NOT use curl to send Chinese characters in JSON. curl corrupts UTF-8 encoding and the server won't correctly recognize Chinese keywords, causing lookup failures.
bash
# ❌ Wrong: curl corrupts Chinese characters in JSON
curl -X POST http://127.0.0.1:7826/api/find_text -d '{"text_keyword":"领取"}'
# ✅ Correct: use Python requests for Chinese parameters
python -c "import requests; r = requests.post('http://127.0.0.1:7826/api/find_text', json={'text_keyword': '领取'}); print(r.text)"
APIs with English-only parameters (e.g., detect_desktop, click_icon, run_script, click_at) may use curl. APIs involving Chinese keywords (find_text, click_text, detect_page page names) must use Python.
Complete API Index (54 endpoints)
All endpoints below are accessible via HTTP POST/GET at http://127.0.0.1:7826.
For AI Agents: You cannot see the camera feed directly. Use these APIs to understand the phone screen state:
GET /api/get_frame_info — frame metadata
GET /api/is_phone_present — detect if phone is in frame
GET /api/is_screen_on — detect if screen is lit
POST /api/screenshot {"return_base64": true} — get base64 image data
POST /api/detect_page — detect current page name
Core Principles:
Arm / camera / script engine are exclusive resources — only one task may use them at a time
All vision operations rely on template matching (icons) and OCR (text)
Synchronous blocking — except /api/run_script, all API commands are synchronous and blocking. You must wait for the HTTP response (with "ok": true indicating completion) before sending the next command. run_script launches a background thread and returns immediately; monitor it with script_status, script_progress, stop_script
Resource protection: action commands are rejected with "script is running" during script execution
Scripts are interpreted, no compilation needed, edit-and-run
The robot arm auto-resets after script completion
Quick Start: Hello FlexArm
Step 1: Confirm service is running
bash
# Start the service
RobotArmServer.exe
# Default port: 7826
On startup the program auto-detects and initializes:
Checks if the robot arm Windows service is running
If not, tries to auto-install and start it
Auto-detects the arm's COM port and connects
Auto-loads the latest calibration file (or starts auto-calibration if none exists)
Checks license (shows activation dialog if unlicensed)
Note: First-time use requires Administrator privileges to install the Windows service. Run RobotArmServer.exeas Administrator. In daily use, administrator rights are not needed if the service is already installed.
If service installation fails, the program still starts but the arm is unavailable. You can manually run robot-arm-service\安装.bat as Administrator to install the service.
The example above only needs calibration — no icon templates or page config required.
To learn more advanced actions (icon clicks, OCR text clicks, page switching, conditional branches), continue reading to understand icon templates and page definitions.
GET /api/is_phone_present
GET /api/is_phone_present?bright_threshold=60&bright_ratio=0.08
Returns:
json
{"ok": true, "data": {"present": true}}
Detect screen on/off
text
GET /api/is_screen_on
GET /api/is_screen_on?dark_threshold=30&dark_ratio=0.7
Returns:
json
{"ok": true, "data": {"screen_on": true}}
Toggle phone corners
text
POST /api/toggle_phone_corners
Overlays a green phone screen border on the display window.
Screenshot
text
POST /api/screenshot {"path": "screenshots/test.png"} # Save to file
POST /api/screenshot {"return_base64": true} # Return base64 (recommended for AI Agents)
POST /api/screenshot {"phone_only": true} # Crop to phone area only
POST /api/screenshot {"show_board": true} # Full view with ruler
List screenshots
text
GET /api/screenshots
GET /api/screenshots?limit=10
POST /api/click_icons
{"paths": ["icons/phone/num1.png", "icons/phone/num3.png", "icons/phone/num2.png"], "interval": 1}
Clicks each icon sequentially. After each click the arm exits the frame, then resets after all clicks. Returns {"ok": true, "data": {"clicked": true, "success_count": N, "failed": []}}.
Click same icon multiple times
text
POST /api/click_icon_many_times
{"path": "icons/qishui/like.png", "count": 3, "interval": 0.5}
Searches for the icon once, then clicks the same position multiple times without moving or resetting. Resets only after all clicks. Returns {"ok": true, "data": {"clicked": true, "clicks": 3}}.
✅ Task complete: Qishui Music is open, currently on the Music page.
Or more directly, if app_desktop.yaml is properly configured and the Qishui Music icon exists, you can use the run_app API endpoint directly. It will intelligently auto-navigate, find the correct desktop page, and click the icon.