SMA AutoUI
https://pypi.org/project/sma-autoui/
智能移动自动化 UI 框架
🚀 快速开始
# 从 PyPI 安装
pip install sma-autoui
# 或从源码安装
pip install .
🌟 核心特性
- ✅ 多平台适配: 支持多个社交平台 API 集成
- ✅ Session 复用: 跨任务会话管理架构
- ✅ 视觉匹配: SIFT + OCR 双模式识别
- ✅ ADB 直达: 浏览器链接直接跳转设计
- ✅ AI 驱动: LLM 接口封装
- ✅ 自愈能力: UI 异常诊断与自动恢复
📦 项目结构
框架核心层 (sma_autoui/)
Driver 层 - 设备交互与自动化驱动
driver/- ADB/Appium/Vision 三层驱动actions.py- 动作执行(点击/滑动/按键)locator.py- 元素定位与查找automator.py- Appium Session 管理vision.py- 视觉识别与图像处理browser.py- 浏览器控制
Vision 层 - 纯视觉分析能力
vision/- SIFT/模板匹配/OCRbusiness_matchers/- 业务图像匹配器assets/- 平台图标资源库
LLM 层 - 大模型交互封装
llm/- API 调用与提示词管理client.py- 模型请求与 Token 统计parser.py- 结果解析与后处理
Common 层 - 零业务依赖工具集
common/- 通用工具函数库config.py- 全局配置管理logger.py- 日志系统notifier.py- 飞书通知uploader.py- 文件上传服务
Platform 层 - 平台业务逻辑抽象
platform/- 平台级公共功能tiktok/- TikTok 平台实现fb/- Facebook 平台实现wa/- WhatsApp 平台实现
Engine 层 - 运行时调度与编排
engine/- 任务调度框架runner.py- TaskRunner(重试/保活/追踪)recovery.py- RecoveryController(自愈策略)
Flows 层 - AI 认知工作流
flows/- AI 任务管线base_flow.py- Flow 基类gen_comment_flow.py- 评论生成工作流diagnosis_flow.py- 异常诊断工作流
Store 层 - 数据持久化
store/- 规则与缓存存储rule_store.py- 规则 CRUDdefault_rules_*.json- 默认规则集
📖 文档说明
完整文档请查看 docs 文件夹:
| 文档 | 用途 |
|---|---|
| 🛠️ 配置指南 | 环境搭建与验证 |
| 🏗️ 系统架构 | 系统设计 & 模块结构 |
| 💡 点击机制 | ADB vs Appium vs W3C Actions |
| ⚠️ 常见问题 | 常见错误与解决方案 |
| 🛣️ 路线图 | 开发计划 |
💻 使用示例
# 基本使用流程示例
from sma_autoui.driver import Driver, Device
# 1. 初始化设备
device = Device(device_name="172.25.2.20:5555", adb_port=5002)
# 2. 创建驱动实例
driver = Driver(
device=device,
appium_url="http://localhost:4723/wd/hub",
task_name="example_task"
)
# 3. 使用高级 API
driver.smart_find(locators=[...], timeout=10)
driver.tap_by_adb(x=500, y=800)
# 4. 任务自动重试与保活
# TaskRunner 会处理异常恢复和 Session 管理
详细使用请参考各模块文档。
🔧 从源码安装
git clone https://github.com/Fun-Fox/sma_autoui.git
cd sma_autoui
pip install -r requirements.txt
pip install -e .
📄 开源协议
MIT License
Built with ❤️ by FunFox
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sma_autoui-0.2.8.tar.gz
(2.5 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sma_autoui-0.2.8.tar.gz.
File metadata
- Download URL: sma_autoui-0.2.8.tar.gz
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5c7476635d7841b0efd374a81237f169381b5cb746a69abcaae6f3b462fade3
|
|
| MD5 |
198b54980094be0d323e1bcd46988aa1
|
|
| BLAKE2b-256 |
f005d35b8f3d76f5da1064f2bc0e0326e5407de5d8f7c32881c37a6a73db556f
|
File details
Details for the file sma_autoui-0.2.8-py3-none-any.whl.
File metadata
- Download URL: sma_autoui-0.2.8-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71c3ce663240be776eb145b9a3a56ad6a06ee306180202bc8c943fe4b63f0e1
|
|
| MD5 |
3303395b8c026bd98ffaabc9de203b23
|
|
| BLAKE2b-256 |
791ba443b51204e1220214c836faa85493aa3da14bdc3f699af8e0ca988234fa
|