
@@ -13,7 +13,7 @@
You can use Claude Code with [GLM Coding Plan](https://z.ai/subscribe) and enter the following prompt to quickly deploy this project:
-```
+```text
Access the documentation and install AutoGLM for me
https://raw.githubusercontent.com/zai-org/Open-AutoGLM/refs/heads/main/README_en.md
```
@@ -141,21 +141,21 @@ If you don't want to deploy the model yourself, you can use the following third-
**1. z.ai**
-- Documentation: https://docs.z.ai/api-reference/introduction
+- Documentation:
- `--base-url`: `https://api.z.ai/api/paas/v4`
- `--model`: `autoglm-phone-multilingual`
- `--apikey`: Apply for your own API key on the z.ai platform
**2. Novita AI**
-- Documentation: https://novita.ai/models/model-detail/zai-org-autoglm-phone-9b-multilingual
+- Documentation:
- `--base-url`: `https://api.novita.ai/openai`
- `--model`: `zai-org/autoglm-phone-9b-multilingual`
- `--apikey`: Apply for your own API key on the Novita AI platform
**3. Parasail**
-- Documentation: https://www.saas.parasail.io/serverless?name=auto-glm-9b-multilingual
+- Documentation:
- `--base-url`: `https://api.parasail.io/v1`
- `--model`: `parasail-auto-glm-9b-multilingual`
- `--apikey`: Apply for your own API key on the Parasail platform
@@ -182,7 +182,7 @@ If you prefer to deploy the model locally or on your own server:
- vLLM:
-```shell
+```bash
python3 -m vllm.entrypoints.openai.api_server \
--served-model-name autoglm-phone-9b-multilingual \
--allowed-local-media-path / \
@@ -289,6 +289,7 @@ Ensure the phone and computer are on the same WiFi network, as shown below:
##### HarmonyOS Devices
Ensure the phone and computer are on the same WiFi network:
+
1. Go to `Settings > System & Updates > Developer Options`
2. Enable `USB Debugging` and `Wireless Debugging`
3. Note the displayed IP address and port number
@@ -347,7 +348,7 @@ python main.py --device-type hdc --device-id 192.168.1.100:5555 --base-url http:
### Python API Remote Connection
-#### Android Devices (ADB)
+#### Connect Android Devices (ADB)
```python
from phone_agent.adb import ADBConnection, list_devices
@@ -373,7 +374,7 @@ print(f"Device IP: {ip}")
conn.disconnect("192.168.1.100:5555")
```
-#### HarmonyOS Devices (HDC)
+#### Connect HarmonyOS Devices (HDC)
```python
from phone_agent.hdc import HDCConnection, list_devices
@@ -467,7 +468,7 @@ config = AgentConfig(
When `verbose=True`, the Agent outputs detailed information at each step:
-```
+```text
==================================================
💭 Thinking Process:
--------------------------------------------------
@@ -604,7 +605,7 @@ pytest tests/
### Complete Project Structure
-```
+```text
phone_agent/
├── __init__.py # Package exports
├── agent.py # PhoneAgent main class
@@ -638,6 +639,7 @@ adb devices
```
If the device is still not recognized, please check:
+
1. Whether USB debugging is enabled
2. Whether the USB cable supports data transfer (some cables only support charging)
3. Whether you have tapped "Allow" on the authorization popup on your phone
@@ -646,6 +648,7 @@ If the device is still not recognized, please check:
### Can Open Apps but Cannot Tap
Some devices require both debugging options to be enabled:
+
- **USB Debugging**
- **USB Debugging (Security Settings)**
@@ -662,11 +665,13 @@ Please check in `Settings → Developer Options` that both options are enabled.
This usually means the app is displaying a sensitive page (payment, password, banking apps). The Agent will automatically detect this and request manual takeover.
### Windows Encoding Issues
+
Error message like `UnicodeEncodeError gbk code`
Solution: Add the environment variable before running the code: `PYTHONIOENCODING=utf-8`
### Interactive Mode Not Working in Non-TTY Environment
+
Error like: `EOF when reading a line`
Solution: Use non-interactive mode to specify tasks directly, or switch to a TTY-mode terminal application.
@@ -703,11 +708,13 @@ If you find our work helpful, please cite the following papers:
### Project Overview
Open-AutoGLM is a phone agent framework:
+
- **Input**: User's natural language instructions (e.g., "Open WhatsApp and send a message to John")
- **Output**: Automatically operates the user's Android phone to complete tasks
- **Mechanism**: Screenshot → Vision model understands interface → Outputs tap coordinates → ADB executes actions → Loop
The architecture consists of two parts:
+
1. **Agent Code** (this repository): Runs on the user's computer, responsible for calling models, parsing actions, and controlling the phone
2. **Vision Model Service**: Can be a remote API or deployed locally
@@ -718,15 +725,17 @@ The architecture consists of two parts:
Before starting deployment, confirm the following items with the user:
#### Hardware Requirements
+
- [ ] User has an Android phone (Android 7.0+)
- [ ] User has a USB cable that supports data transfer (not just charging)
- [ ] Phone and computer can be connected via USB cable
#### Phone Configuration
+
- [ ] Phone has Developer Mode enabled (Settings → About Phone → Tap Build Number 7 times)
- [ ] Phone has USB Debugging enabled (Settings → Developer Options → USB Debugging)
- [ ] Some models require enabling "USB Debugging (Security Settings)" as well
-- [ ] ADB Keyboard app is installed (Download: https://github.com/senzhk/ADBKeyBoard/blob/master/ADBKeyboard.apk)
+- [ ] ADB Keyboard app is installed (Download: )
- [ ] ADB Keyboard is enabled in system settings (Settings → Language & Input → Enable ADB Keyboard)
#### Model Service Confirmation (Choose One)
@@ -771,6 +780,7 @@ adb devices
```
**If `adb devices` shows empty list or unauthorized:**
+
1. Check if authorization popup appeared on phone, tap "Allow"
2. Check if USB debugging is enabled
3. Try a different cable or USB port
@@ -801,19 +811,19 @@ pip install -e .
You can use the following third-party model services:
1. **z.ai**
- - Documentation: https://docs.z.ai/api-reference/introduction
+ - Documentation:
- `--base-url`: `https://api.z.ai/api/paas/v4`
- `--model`: `autoglm-phone-multilingual`
- `--apikey`: Apply for your own API key on the z.ai platform
2. **Novita AI**
- - Documentation: https://novita.ai/models/model-detail/zai-org-autoglm-phone-9b-multilingual
+ - Documentation:
- `--base-url`: `https://api.novita.ai/openai`
- `--model`: `zai-org/autoglm-phone-9b-multilingual`
- `--apikey`: Apply for your own API key on the Novita AI platform
3. **Parasail**
- - Documentation: https://www.saas.parasail.io/serverless?name=auto-glm-9b-multilingual
+ - Documentation:
- `--base-url`: `https://api.parasail.io/v1`
- `--model`: `parasail-auto-glm-9b-multilingual`
- `--apikey`: Apply for your own API key on the Parasail platform
@@ -865,6 +875,7 @@ python main.py --base-url {MODEL_URL} --model "autoglm-phone-9b-multilingual" "O
```
**Expected Result:**
+
- Phone automatically opens Gmail
- Automatically searches for recipient
- Automatically sends the message "Deployment successful"
diff --git a/docs/android_setup.md b/docs/android_setup.md
new file mode 100644
index 00000000..5b6313cb
--- /dev/null
+++ b/docs/android_setup.md
@@ -0,0 +1,26 @@
+# Android 环境配置指南
+
+## 1. Python 环境
+
+建议使用 Python 3.10 及以上版本。
+
+## 2. Android 7.0+ 或 HarmonyOS 设备,并启用 `开发者模式` 和 `USB 调试`
+
+1. 开发者模式启用:通常启用方法是,找到 `设置-关于手机-版本号` 然后连续快速点击 10
+ 次左右,直到弹出弹窗显示“开发者模式已启用”。不同手机会有些许差别,如果找不到,可以上网搜索一下教程。
+2. USB 调试启用:启用开发者模式之后,会出现 `设置-开发者选项-USB 调试`,勾选启用
+3. 部分机型在设置开发者选项以后,可能需要重启设备才能生效。可以测试一下:将手机用 USB 数据线连接到电脑后,`adb devices`
+ 查看是否有设备信息,如果没有说明连接失败。
+
+**请务必仔细检查相关权限**
+
+
+
+## 3. 安装 ADB Keyboard(仅 Android 设备需要,用于文本输入)
+
+**注意:鸿蒙设备使用原生输入方法,无需安装 ADB Keyboard。**
+
+如果你使用的是 Android 设备:
+
+下载 [安装包](https://github.com/senzhk/ADBKeyBoard/blob/master/ADBKeyboard.apk) 并在对应的安卓设备中进行安装。
+注意,安装完成后还需要到 `设置-输入法` 或者 `设置-键盘列表` 中启用 `ADB Keyboard` 才能生效 (或使用命令`adb shell ime enable com.android.adbkeyboard/.AdbIME`[How-to-use](https://github.com/senzhk/ADBKeyBoard/blob/master/README.md#how-to-use))
diff --git a/docs/ios_setup/resources/enable-ui-automation.jpg b/docs/assets/ios_setup/enable-ui-automation.jpg
similarity index 100%
rename from docs/ios_setup/resources/enable-ui-automation.jpg
rename to docs/assets/ios_setup/enable-ui-automation.jpg
diff --git a/docs/ios_setup/resources/ios0_WebDriverAgent0.png b/docs/assets/ios_setup/ios0_WebDriverAgent0.png
similarity index 100%
rename from docs/ios_setup/resources/ios0_WebDriverAgent0.png
rename to docs/assets/ios_setup/ios0_WebDriverAgent0.png
diff --git a/docs/ios_setup/resources/ios0_WebDriverAgent1.png b/docs/assets/ios_setup/ios0_WebDriverAgent1.png
similarity index 100%
rename from docs/ios_setup/resources/ios0_WebDriverAgent1.png
rename to docs/assets/ios_setup/ios0_WebDriverAgent1.png
diff --git a/docs/ios_setup/resources/select-your-iphone-device.png b/docs/assets/ios_setup/select-your-iphone-device.png
similarity index 100%
rename from docs/ios_setup/resources/select-your-iphone-device.png
rename to docs/assets/ios_setup/select-your-iphone-device.png
diff --git a/docs/ios_setup/resources/setup-xcode-wda.png b/docs/assets/ios_setup/setup-xcode-wda.png
similarity index 100%
rename from docs/ios_setup/resources/setup-xcode-wda.png
rename to docs/assets/ios_setup/setup-xcode-wda.png
diff --git a/docs/ios_setup/resources/start-wda-testing.png b/docs/assets/ios_setup/start-wda-testing.png
similarity index 100%
rename from docs/ios_setup/resources/start-wda-testing.png
rename to docs/assets/ios_setup/start-wda-testing.png
diff --git a/docs/ios_setup/resources/trust-dev-app.jpg b/docs/assets/ios_setup/trust-dev-app.jpg
similarity index 100%
rename from docs/ios_setup/resources/trust-dev-app.jpg
rename to docs/assets/ios_setup/trust-dev-app.jpg
diff --git a/resources/setting.png b/docs/assets/remote_control/setting.png
similarity index 100%
rename from resources/setting.png
rename to docs/assets/remote_control/setting.png
diff --git a/docs/development.md b/docs/development.md
new file mode 100644
index 00000000..ee3e12e0
--- /dev/null
+++ b/docs/development.md
@@ -0,0 +1,36 @@
+# 二次开发
+
+## 配置开发环境
+
+二次开发需要使用开发依赖:
+
+```bash
+pip install -e ".[dev]"
+```
+
+## 运行测试
+
+```bash
+pytest tests/
+```
+
+## 完整项目结构
+
+```text
+phone_agent/
+├── __init__.py # 包导出
+├── agent.py # PhoneAgent 主类
+├── adb/ # ADB 工具
+│ ├── connection.py # 远程/本地连接管理
+│ ├── screenshot.py # 屏幕截图
+│ ├── input.py # 文本输入 (ADB Keyboard)
+│ └── device.py # 设备控制 (点击、滑动等)
+├── actions/ # 操作处理
+│ └── handler.py # 操作执行器
+├── config/ # 配置
+│ ├── apps.py # 支持的应用映射
+│ ├── prompts_zh.py # 中文系统提示词
+│ └── prompts_en.py # 英文系统提示词
+└── model/ # AI 模型客户端
+ └── client.py # OpenAI 兼容客户端
+```
diff --git a/docs/environment.md b/docs/environment.md
new file mode 100644
index 00000000..b6b76c4a
--- /dev/null
+++ b/docs/environment.md
@@ -0,0 +1,224 @@
+# 环境与模型部署指南
+
+## 1. 克隆仓库
+
+```bash
+git clone https://github.com/zai-org/Open-AutoGLM.git
+cd Open-AutoGLM
+```
+
+## 2. 安装依赖
+
+```bash
+pip install -r requirements.txt
+pip install -e .
+```
+
+## 3. 配置与手机的连接
+
+根据你的设备类型选择相应的工具:
+
+### 对于 Android 设备 - 使用 ADB
+
+1. 下载官方 ADB [安装包](https://developer.android.com/tools/releases/platform-tools?hl=zh-cn),并解压到自定义路径。
+2. 配置环境变量。
+ - MacOS 配置方法:在 `Terminal` 或者任何命令行工具里
+
+ ```bash
+ # 假设解压后的目录为 ~/Downloads/platform-tools。如果不是请自行调整命令。
+ export PATH=${PATH}:~/Downloads/platform-tools
+ ```
+
+ - Windows 配置方法:可参考 [第三方教程](https://blog.csdn.net/x2584179909/article/details/108319973) 进行配置。
+3. 确认 **USB 数据线具有数据传输功能**, 而不是仅有充电功能。
+4. 确保已安装 ADB 并使用 **USB 数据线** 连接设备。
+5. 检查已连接的设备。
+
+ ```bash
+ # 检查已连接的设备
+ adb devices
+
+ # 输出结果应显示你的设备,如:
+ # List of devices attached
+ # emulator-5554 device
+ ```
+
+### 对于鸿蒙设备 (HarmonyOS NEXT 版本以上) - 使用 HDC
+
+1. 下载 HDC 工具:
+ - 从 [HarmonyOS SDK](https://developer.huawei.com/consumer/cn/download/) 下载
+2. 配置环境变量
+ - MacOS/Linux 配置方法:
+
+ ```bash
+ # 假设解压后的目录为 ~/Downloads/harmonyos-sdk/toolchains。请根据实际路径调整。
+ export PATH=${PATH}:~/Downloads/harmonyos-sdk/toolchains
+ ```
+
+ - Windows 配置方法:将 HDC 工具所在目录添加到系统 PATH 环境变量
+3. 确认 **USB 数据线具有数据传输功能**, 而不是仅有充电功能
+4. 确保已安装 HDC 并使用 **USB 数据线** 连接设备
+5. 检查已连接的设备。
+
+ ```bash
+ # 检查已连接的设备
+ hdc list targets
+
+ # 输出结果应显示你的设备,如:
+ # 7001005458323933328a01bce01c2500
+ ```
+
+### 对于 iOS 设备(WebDriverAgent)
+
+请参考 [iOS 环境配置指南](ios_setup.md) 进行配置。
+
+## 4. 启动模型服务
+
+你可以选择自行部署模型服务,或使用第三方模型服务商。
+
+### 选项 A: 使用第三方模型服务
+
+如果你不想自行部署模型,可以使用以下已部署我们模型的第三方服务:
+
+1. 智谱 BigModel
+ - [智谱 BigModel 文档](https://docs.bigmodel.cn/cn/api/introduction)
+ - 参数说明:
+ - `--base-url`: `https://open.bigmodel.cn/api/paas/v4`
+ - `--model`: `autoglm-phone`
+ - `--apikey`: 在智谱平台申请你的 API Key
+ - 使用示例:
+
+ ```bash
+ python main.py --base-url https://open.bigmodel.cn/api/paas/v4 --model "autoglm-phone" --apikey "your-bigmodel-api-key" "打开美团搜索附近的火锅店"
+ ```
+
+2. ModelScope(魔搭社区)
+ - [ModelScope 文档](https://modelscope.cn/models/ZhipuAI/AutoGLM-Phone-9B)
+ - 参数说明:
+ - `--base-url`: `https://api-inference.modelscope.cn/v1`
+ - `--model`: `ZhipuAI/AutoGLM-Phone-9B`
+ - `--apikey`: 在 ModelScope 平台申请你的 API Key
+ - 使用示例:
+
+ ```bash
+ python main.py --base-url https://api-inference.modelscope.cn/v1 --model "ZhipuAI/AutoGLM-Phone-9B" --apikey "your-modelscope-api-key" "打开美团搜索附近的火锅店"
+ ```
+
+### 选项 B: 自行部署模型
+
+如果你希望在本地或自己的服务器上部署模型,可以选择 vLLM 或 SGLang 两种主流推理框架。
+
+注意:无论选择哪种推理引擎,**安装或升级 transformers** 至 `5.0.0rc0` 或更高 (`pip install -U transformers --pre`)。
+
+#### vLLM 部署流程
+
+1. **安装 vLLM 和 transformers**
+ - 直接用 pip 安装(如本地 GPU 环境):
+
+ ```bash
+ pip install "vllm>=0.12.0"
+ pip install -U transformers --pre
+ ```
+
+ - 或使用官方 Docker 镜像:
+
+ ```bash
+ docker pull vllm/vllm-openai:v0.12.0
+ ```
+
+ 进入容器后同样执行:
+
+ ```bash
+ pip install -U transformers --pre
+ ```
+
+2. 下载模型(如:zai-org/AutoGLM-Phone-9B)
+3. 启动 vLLM OpenAI 接口服务,**务必严格按参数设置**:
+
+ ```bash
+ python3 -m vllm.entrypoints.openai.api_server \
+ --served-model-name autoglm-phone-9b \
+ --allowed-local-media-path / \
+ --mm-encoder-tp-mode data \
+ --mm_processor_cache_type shm \
+ --mm_processor_kwargs "{\"max_pixels\":5000000}" \
+ --max-model-len 25480 \
+ --chat-template-content-format string \
+ --limit-mm-per-prompt "{\"image\":10}" \
+ --model zai-org/AutoGLM-Phone-9B \
+ --port 8000
+ ```
+
+#### SGLang 部署流程
+
+1. **安装 SGLang 和 transformers**
+ - 通过 pip 安装(需按依赖处理 CUDA/cudnn 环境):
+
+ ```bash
+ pip install "sglang>=0.5.6.post1"
+ pip install -U transformers --pre
+ ```
+
+ - 或使用官方 Docker 镜像(如无需本地编译):
+
+ ```bash
+ docker pull lmsysorg/sglang:v0.5.6.post1
+ ```
+
+ 进入容器后,如需可选多模态功能,还需安装 CUDNN:
+
+ ```bash
+ pip install nvidia-cudnn-cu12==9.16.0.29
+ pip install -U transformers --pre
+ ```
+
+2. 下载模型(如:`zai-org/AutoGLM-Phone-9B`)
+
+3. 启动 SGLang OpenAI 格式服务,**务必严格按参数设置**:
+
+ ```bash
+ python3 -m sglang.launch_server \
+ --model-path zai-org/AutoGLM-Phone-9B \
+ --served-model-name autoglm-phone-9b \
+ --context-length 25480 \
+ --mm-enable-dp-encoder \
+ --mm-process-config '{"image":{"max_pixels":5000000}}' \
+ --port 8000
+ ```
+
+---
+
+- 该模型结构与 `GLM-4.1V-9B-Thinking` 相同,详细部署流程可参考 [GLM-V](https://github.com/zai-org/GLM-V) 仓库。
+- 启动成功后,可通过 `http://localhost:8000/v1` 访问模型 OpenAI 接口。如果在远程服务器上运行,请用对应服务器的 IP 地址替换 `localhost`。
+
+## 5. 检查模型部署
+
+模型服务启动后,可以使用检查脚本验证部署是否成功:
+
+```bash
+python scripts/check_deployment_cn.py --base-url http://你的IP:你的端口/v1 --model 模型名称
+```
+
+脚本将发送测试请求并展示模型的推理结果,你可以根据输出判断模型部署是否正常工作。
+
+基于给定的任务,预期输出如下。**如果思维链长度很短,或者出现了乱码,很可能是模型部署失败**, 请仔细检查文档要求的配置和依赖。
+
+```text
+用户想要比较这个洗发水在京东和淘宝上的价格,然后选择最便宜的平台下单。当前在小红书 app 上,显示的是一个关于 LUMMI MOOD 洗发水的帖子。
+
+我需要:
+1. 先启动京东 app,搜索这个洗发水
+2. 查看京东的价格
+3. 再启动淘宝 app,搜索这个洗发水
+4. 查看淘宝的价格
+5. 比较价格后,选择最便宜的京东或淘宝下单
+
+首先,我需要从当前的小红书界面退出,然后启动京东 app。
+do(action="Launch", app="京东")
+```
+
+参数说明:
+
+- `--base-url`: 模型服务地址 (根据实际部署地址修改)
+- `--model`: 模型名称
+- `--messages-file`: 可选,指定自定义测试消息文件 (默认使用 `scripts/sample_messages.json`)
diff --git a/docs/ios_setup.md b/docs/ios_setup.md
new file mode 100644
index 00000000..56cff752
--- /dev/null
+++ b/docs/ios_setup.md
@@ -0,0 +1,137 @@
+# iOS 环境配置指南
+
+本文档介绍如何为 Open-AutoGLM 配置 iOS 设备环境。
+
+## 环境要求
+
+- macOS 操作系统
+- Xcode(最新版本,在 App store 中下载)
+- 苹果开发者账号(免费账号即可,无需付费)
+- iOS 设备(iPhone/iPad)
+- USB 数据线或同一 WiFi 网络
+
+## WebDriverAgent 配置
+
+WebDriverAgent 是 iOS 自动化的核心组件,需要在 iOS 设备上运行。
+
+### 1. 克隆 WebDriverAgent
+
+```bash
+git clone https://github.com/appium/WebDriverAgent.git
+cd WebDriverAgent
+```
+
+直接点击`WebDriverAgent.xcodeproj`即可使用 Xcode 打开。
+
+### 2. 设置 Signing & Capabilities
+
+1. 在 Xcode 中选中 `WebDriverAgent`,出现 General、Signing&Capabilities 等选项。
+2. 进入 `Signing & Capabilities` 选项卡
+3. 勾选 `Automatically manage signing`。在 Team 中选择自己的开发者账号
+4. 将 Bundle ID 改为唯一标识符,例如:`com.yourname.WebDriverAgentRunner`
+
+
+5. TARGETS 中,建议将 WebDriverAgentLib、WebDriverAgentRunner、IntegrationApp 的`Signing & Capabilities` 都按照相同方式设置。
+
+
+### 3. 测试 XCode 的 GUI 模式和 UI 自动化设置
+
+建议先测试 GUI 模式能否成功安装 WebDriverAgent,再进行后续步骤。
+Mac 和 iPhone 有 USB 和 WiFi 两种连接方式,建议通过 USB 方式,成功率更高。
+
+#### 通过 WiFi 连接
+
+需要满足以下条件:
+
+1. 通过 USB 连接。在 Finder 中选中连接的 IPhone,在“通用”中勾选"在 WiFi 中显示这台 iPhone"
+2. Mac 与 iPhone 处于同一 WiFi 网络之下
+
+#### 具体步骤
+
+1. 从项目 Target 选择 `WebDriverAgentRunner`
+2. 选择你的设备
+
+ 
+
+3. 长按"▶️"运行按钮,选择 "Test" 后开始编译并部署到你的 iPhone 上
+
+ 
+
+部署成功的标志:1. XCode 没有报错。2. 你可以在 iPhone 上找到名为 WebDriverAgentRunner 的 App
+
+#### 设备信任配置
+
+首次运行时,需要在 iPhone 上完成以下设置,然后重新编译和部署:
+
+1. **输入解锁密码**
+2. **信任开发者应用**
+ - 进入:设置 → 通用 → VPN 与设备管理
+ - 在“开发者 App”中选择对应开发者
+ - 点击信任“XXX”
+
+ 
+
+3. **启用 UI 自动化**
+ - 进入:设置 → 开发者
+ - 打开 UI 自动化设置
+
+ 
+
+### 4. XCode 命令行模式部署
+
+1.安装 libimobiledevice,用于与 iPhone / iPad 建立连接与通信。
+
+ ```bash
+ brew install libimobiledevice
+ # 设备检查
+ idevice_id -ln
+ ```
+
+2.使用 xcodebuild 安装 WebAgent。命令行也需要进行“设备信任配置”,参考 GUI 模式下的方法。
+
+```bash
+cd WebDriverAgent
+
+xcodebuild -project WebDriverAgent.xcodeproj \
+ -scheme WebDriverAgentRunner \
+ -destination 'platform=iOS,name=YOUR_PHONE_NAME' \
+ test
+```
+
+这里,YOUR_PHONE_NAME 可以在 xcode 的 GUI 中看到。
+WebDriverAgent 成功运行后,会在 Xcode 控制台输出类似以下信息:
+
+```text
+ServerURLHere->http://[设备 IP]:8100<-ServerURLHere
+```
+
+同时,观察到手机上安装好了 WebDriverAgentRunner,屏幕显示 Automation Running 字样。
+其中,`http://[设备 IP]:8100` 为 WiFi 所需的 WDA_URL。
+
+## 使用 AutoGLM
+
+以上配置完成后,先打开一个新终端,在后台建立端口映射(使用 WiFi 连接则不需要):
+
+```bash
+iproxy 8100 8100
+```
+
+之后,打开一个新终端,通过以下命令使用 AutoGLM(WiFi 则使用上述获得的 WDA_URL):
+
+```bash
+python ios.py --base-url "YOUR_BASE_URL" \
+ --model "autoglm-phone" \
+ --api-key "YOUR_API_KEY" \
+ --wda-url http://localhost:8100 \
+ "TASK"
+```
+
+## 参考资源
+
+- [WebDriverAgent 官方仓库](https://github.com/appium/WebDriverAgent)
+- [PR141](https://github.com/zai-org/Open-AutoGLM/pull/141)
+- [Gekowa 提供的 ios 方案](https://github.com/gekowa/Open-AutoGLM/tree/ios-support)
+
+---
+
+如有其他问题,请参考主项目 README 或提交 Issue。
diff --git a/docs/ios_setup/ios_setup.md b/docs/ios_setup/ios_setup.md
deleted file mode 100644
index a2b22fee..00000000
--- a/docs/ios_setup/ios_setup.md
+++ /dev/null
@@ -1,134 +0,0 @@
-# iOS 环境配置指南
-
-本文档介绍如何为 Open-AutoGLM 配置 iOS 设备环境。
-
-## 环境要求
-
-- macOS 操作系统
-- Xcode(最新版本,在App store中下载)
-- 苹果开发者账号(免费账号即可,无需付费)
-- iOS 设备(iPhone/iPad)
-- USB 数据线或同一 WiFi 网络
-
-
-## WebDriverAgent 配置
-
-WebDriverAgent 是 iOS 自动化的核心组件,需要在 iOS 设备上运行。
-
-### 1. 克隆 WebDriverAgent
-
-```bash
-git clone https://github.com/appium/WebDriverAgent.git
-cd WebDriverAgent
-```
-
-直接点击`WebDriverAgent.xcodeproj`即可使用Xcode打开。
-
-### 2. 设置 Signing & Capabilities
-
-1. 在 Xcode 中选中 `WebDriverAgent`,出现General、Signing&Capabilities等选项。
-2. 进入 `Signing & Capabilities` 选项卡
-3. 勾选 `Automatically manage signing`。在Team中选择自己的开发者账号
-4. 将 Bundle ID 改为唯一标识符,例如:`com.yourname.WebDriverAgentRunner`
-
-
-5. TARGETS中,建议将WebDriverAgentLib、WebDriverAgentRunner、IntegrationApp的`Signing & Capabilities` 都按照相同方式设置。
-
-
-### 3. 测试XCode的GUI模式和UI自动化设置
-
-建议先测试GUI模式能否成功安装WebDriverAgent,再进行后续步骤。
-Mac和iPhone有USB和WiFi两种连接方式,建议通过USB方式,成功率更高。
-
-#### 通过 WiFi 连接
-
-需要满足以下条件:
-1. 通过USB连接。在Finder中选中连接的IPhone,在“通用”中勾选"在 WiFi 中显示这台 iPhone"
-2. Mac 与 iPhone 处于同一 WiFi 网络之下
-
-#### 具体步骤
-1. 从项目 Target 选择 `WebDriverAgentRunner`
-2. 选择你的设备
-
-
-
-3. 长按"▶️"运行按钮,选择 "Test" 后开始编译并部署到你的 iPhone 上
-
-
-
-部署成功的标志:1. XCode没有报错。2. 你可以在iPhone上找到名为WebDriverAgentRunner的App
-
-#### 设备信任配置
-
-首次运行时,需要在 iPhone 上完成以下设置,然后重新编译和部署:
-
-1. **输入解锁密码**
-2. **信任开发者应用**
- - 进入:设置 → 通用 → VPN与设备管理
- - 在“开发者 App”中选择对应开发者
- - 点击信任“XXX”
-
- 
-
-3. **启用 UI 自动化**
- - 进入:设置 → 开发者
- - 打开 UI 自动化设置
-
- 
-
-### 4. XCode命令行模式部署
-
-1.安装libimobiledevice,用于与 iPhone / iPad 建立连接与通信。
-
-```
-brew install libimobiledevice
-# 设备检查
-idevice_id -ln
-```
-2.使用xcodebuild安装WebAgent。命令行也需要进行“设备信任配置”,参考GUI模式下的方法。
-
-```
-cd WebDriverAgent
-
-xcodebuild -project WebDriverAgent.xcodeproj \
- -scheme WebDriverAgentRunner \
- -destination 'platform=iOS,name=YOUR_PHONE_NAME' \
- test
-```
-这里,YOUR_PHONE_NAME可以在xcode的GUI中看到。
-WebDriverAgent 成功运行后,会在 Xcode 控制台输出类似以下信息:
-
-```
-ServerURLHere->http://[设备IP]:8100<-ServerURLHere
-```
-
-同时,观察到手机上安装好了WebDriverAgentRunner,屏幕显示Automation Running字样。
-其中,**http://[设备IP]:8100**为WiFi所需的WDA_URL。
-
-## 使用 AutoGLM
-
-以上配置完成后,先打开一个新终端,在后台建立端口映射(使用WiFi连接则不需要):
-
-```bash
- iproxy 8100 8100
-```
-
-之后,打开一个新终端,通过以下命令使用AutoGLM(WiFi则使用上述获得的WDA_URL):
-
-```bash
-python ios.py --base-url "YOUR_BASE_URL" \
- --model "autoglm-phone" \
- --api-key "YOUR_API_KEY" \
- --wda-url http://localhost:8100 \
- "TASK"
-```
-
-## 参考资源
-
-- [WebDriverAgent 官方仓库](https://github.com/appium/WebDriverAgent)
-- [PR141](https://github.com/zai-org/Open-AutoGLM/pull/141)
-- [Gekowa提供的ios方案](https://github.com/gekowa/Open-AutoGLM/tree/ios-support)
-
----
-
-如有其他问题,请参考主项目 README 或提交 Issue。
diff --git a/docs/remote_control.md b/docs/remote_control.md
new file mode 100644
index 00000000..12bd483b
--- /dev/null
+++ b/docs/remote_control.md
@@ -0,0 +1,140 @@
+# 远程控制指南
+
+Phone Agent 支持通过 WiFi/网络进行远程 ADB/HDC 调试,无需 USB 连接即可控制设备。
+
+## 配置远程调试
+
+### 在手机端开启无线调试
+
+#### Android 设备
+
+确保手机和电脑在同一个 WiFi 中,如图所示
+
+
+
+#### 鸿蒙设备
+
+确保手机和电脑在同一个 WiFi 中:
+
+1. 进入 `设置 > 系统和更新 > 开发者选项`
+2. 开启 `USB 调试` 和 `无线调试`
+3. 记录显示的 IP 地址和端口号
+
+### 在电脑端使用标准 ADB/HDC 命令
+
+```bash
+# Android 设备 - 通过 WiFi 连接, 改成手机显示的 IP 地址和端口
+adb connect 192.168.1.100:5555
+
+# 验证连接
+adb devices
+# 应显示:192.168.1.100:5555 device
+
+# 鸿蒙设备 - 通过 WiFi 连接
+hdc tconn 192.168.1.100:5555
+
+# 验证连接
+hdc list targets
+# 应显示:192.168.1.100:5555
+```
+
+## 设备管理命令
+
+### Android 设备(ADB)
+
+```bash
+# 列出所有已连接设备
+adb devices
+
+# 连接远程设备
+adb connect 192.168.1.100:5555
+
+# 断开指定设备
+adb disconnect 192.168.1.100:5555
+
+# 指定设备执行任务
+python main.py --device-id 192.168.1.100:5555 --base-url http://localhost:8000/v1 --model "autoglm-phone-9b" "打开抖音刷视频"
+```
+
+### 鸿蒙设备(HDC)
+
+```bash
+# 列出所有已连接设备
+hdc list targets
+
+# 连接远程设备
+hdc tconn 192.168.1.100:5555
+
+# 断开指定设备
+hdc tdisconn 192.168.1.100:5555
+
+# 指定设备执行任务
+python main.py --device-type hdc --device-id 192.168.1.100:5555 --base-url http://localhost:8000/v1 --model "autoglm-phone-9b" "打开抖音刷视频"
+```
+
+## Python API 远程连接
+
+### 连接 Android 设备(ADB)
+
+```python
+from phone_agent.adb import ADBConnection, list_devices
+
+# 创建连接管理器
+conn = ADBConnection()
+
+# 连接远程设备
+success, message = conn.connect("192.168.1.100:5555")
+print(f"连接状态:{message}")
+
+# 列出已连接设备
+devices = list_devices()
+for device in devices:
+ print(f"{device.device_id} - {device.connection_type.value}")
+
+# 在 USB 设备上启用 TCP/IP
+success, message = conn.enable_tcpip(5555)
+ip = conn.get_device_ip()
+print(f"设备 IP: {ip}")
+
+# 断开连接
+conn.disconnect("192.168.1.100:5555")
+```
+
+### 连接鸿蒙设备(HDC)
+
+```python
+from phone_agent.hdc import HDCConnection, list_devices
+
+# 创建连接管理器
+conn = HDCConnection()
+
+# 连接远程设备
+success, message = conn.connect("192.168.1.100:5555")
+print(f"连接状态:{message}")
+
+# 列出已连接设备
+devices = list_devices()
+for device in devices:
+ print(f"{device.device_id} - {device.connection_type.value}")
+
+# 断开连接
+conn.disconnect("192.168.1.100:5555")
+```
+
+## 远程连接问题排查
+
+### 连接被拒绝
+
+- 确保设备和电脑在同一网络
+- 检查防火墙是否阻止 5555 端口
+- 确认已启用 TCP/IP 模式:`adb tcpip 5555`
+
+### 连接断开
+
+- WiFi 可能断开了,使用 `--connect` 重新连接
+- 部分设备重启后会禁用 TCP/IP,需要通过 USB 重新启用
+
+### 多设备
+
+- 使用 `--device-id` 指定要使用的设备
+- 或使用 `--list-devices` 查看所有已连接设备
diff --git a/resources/WECHAT.md b/resources/WECHAT.md
index bfdde84e..d11cf307 100644
--- a/resources/WECHAT.md
+++ b/resources/WECHAT.md
@@ -1,6 +1,7 @@
-
-

+# WeChat Community
+
+
扫码加入「Open-AutoGLM 交流群」
Scan the QR code to follow the official account and join the "Open-AutoGLM Discussion Group"