autool/DroidBot/README.md
2026-06-17 19:44:18 +08:00

63 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# DroidBot - 多平台自动化 UI 测试框架
DroidBot 是一个轻量级的自动化 UI 测试框架,支持多平台(目前支持 Android。通过智能的 UI 探索策略和可扩展的架构设计,帮助开发者进行应用测试和 UI 自动化。
## 特性
- **多平台支持**: 采用抽象工厂模式,易于扩展新平台
- **智能探索**: 基于记忆引导的 UI 探索策略 (MemoryGuidedPolicy)
- **CV 模式**: 支持计算机视觉识别 UI 元素
- **GuiAgent 集成**: 可集成 LLM 驱动的 GUI 代理处理复杂场景
- **脚本支持**: 支持自定义脚本控制测试流程
## 快速开始
### 安装
```bash
cd DroidBot
pip install -e .
```
### 运行
```bash
python start.py -d <device_serial> -a <package_name> -o <output_dir>
```
### 主要参数
| 参数 | 说明 |
|------|------|
| `-d` | 设备序列号 |
| `-a` | 被测应用包名 |
| `-o` | 输出目录 |
| `-policy` | 探索策略 (memory_guided, manual, none) |
| `-cv_mode` | 启用 CV 模式 |
| `--enable_guiagent` | 启用 GuiAgent |
## 架构
```
droidbot/
├── core/ # 核心抽象层
│ ├── abstract_device.py # 设备抽象基类
│ ├── abstract_device_state.py # 状态抽象基类
│ ├── abstract_input_event.py # 事件抽象基类
│ └── platform_factory.py # 平台工厂
├── platforms/ # 平台实现
│ ├── android/ # Android 实现
│ └── ios/ # iOS 预留
├── input_policy.py # 输入策略
├── input_manager.py # 输入管理器
└── utg.py # UI 转换图
```
## 扩展新平台
参见 [PLATFORM_GUIDE.md](./PLATFORM_GUIDE.md) 了解如何添加新平台支持。
## 许可证
MIT License