ld-emulator-mcp
Drives Android emulator instances (LDPlayer) end to end: launch/quit/reboot instances, enable ADB, capture screenshots, dump and tap the UI tree, perform tap/long-press/swipe/type/key events, run adb shell commands, install/uninstall/launch/stop apps, read logcat, and push/pull files.
Signs an existing Google test account into an emulator instance via google_login (credentials read from a local accounts.json, never passed through MCP) and lists the accounts already signed in with google_accounts; halts and returns needs_attention with the screen content when 2FA, CAPTCHA or a block is hit.
Installs apps from Google Play by package ID, Play Store URL or app name: opens the app's store page (or searches by name) and taps the install button, and can switch the active Play account.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ld-emulator-mcp
MCP server điều khiển máy ảo Android LDPlayer trên Windows, dùng để AI (Claude Code, Claude Desktop, VS Code…) tự động test app APK.
MCP server to drive LDPlayer Android emulator instances on Windows: launch/quit instances, screenshots returned as images, UI tree lookup, tap/swipe/type, app install from URL/file/Google Play, Google sign-in of an existing test account.
Đã chạy thử trên LDPlayer 14.0.36 (Android 14). Có hỗ trợ cả LDPlayer 9, nhưng chưa kiểm.
Tính năng
Nhóm | Tool |
Máy ảo |
|
Màn hình |
|
Giao diện |
|
Thao tác |
|
App |
|
|
Chọn máy ảo (target)
Số thứ tự:
0,1…Tên máy ảo:
LDPlayerCổng ADB:
5555, hoặc serial:emulator-5554,127.0.0.1:5555Để trống: dùng máy ảo duy nhất đang chạy.
Quy ước của LDPlayer: máy số i có serial emulator-(5554 + 2i) và cổng ADB 5555 + 2i.
Cài app (app_install)
source nhận một trong các dạng sau (kind=auto tự đoán):
Dạng | Ví dụ | Cách cài |
URL tới |
| Tải về PC rồi |
Tệp trên PC |
|
|
Package ID hoặc link Google Play |
| Mở trang app trên Google Play rồi bấm Cài đặt |
Tên app |
| Tìm trên Google Play, chọn kết quả khớp đầu tiên (có thể sai, nên chụp màn hình kiểm lại) |
Cài qua Google Play cần máy ảo đã đăng nhập tài khoản Google.
Đăng nhập Google (google_login)
Chỉ đăng nhập tài khoản có sẵn. Không có tính năng tạo tài khoản: Google cấm tạo tài khoản tự động.
Mật khẩu không đi qua MCP. Server đọc mật khẩu từ tệp
%USERPROFILE%\.ld-emulator-mcp\accounts.json(đổi đường dẫn bằng biến môi trườngLDMCP_ACCOUNTS_FILE):{"tester1@gmail.com": "mat-khau-1", "tester2@gmail.com": "mat-khau-2"}Khi Google đòi xác minh 2 bước, CAPTCHA, báo sai mật khẩu hoặc chặn đăng nhập, tool dừng và trả
needs_attentionkèm nội dung màn hình. Bạn tự làm tiếp bước đó, hoặc để AI dùngscreenshotvàui_tap.Nên dùng tài khoản test riêng, đã tắt xác minh 2 bước.
Related MCP server: android-emulator
Cài đặt
Yêu cầu: Windows, Python 3.10 trở lên, LDPlayer.
git clone https://github.com/anhyeuviolet/ld-emulator-mcp.git
cd ld-emulator-mcp
python -m venv .venv
.venv\Scripts\pip install -e .Bật ADB cho máy ảo (bắt buộc)
LDPlayer mặc định tắt ADB debugging. Khi tắt, mọi tool thao tác máy ảo đều lỗi. Có hai cách bật:
Trong LDPlayer: Cài đặt → mục Khác → ADB debugging → Kết nối cục bộ. Sau đó khởi động lại máy ảo.
Qua MCP: tắt máy ảo, gọi
instance_set_adb(target="0", enabled=true), rồi bật lại.
Khai báo với Claude Code
claude mcp add ld-emulator -- D:\duong-dan\ld-emulator-mcp\.venv\Scripts\python.exe -m ld_emulator_mcpHoặc thêm vào .mcp.json / claude_desktop_config.json:
{
"mcpServers": {
"ld-emulator": {
"command": "D:\\duong-dan\\ld-emulator-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "ld_emulator_mcp"]
}
}
}Server tự tìm LDPlayer theo thứ tự: biến môi trường LDPLAYER_PATH, registry Windows, rồi các thư mục quen thuộc. Có thể chỉ định thẳng bằng --ldplayer-path E:\LDPlayer\LDPlayer14.
Ví dụ yêu cầu cho AI
Bật máy ảo 0, cài
D:\build\app-release.apk(cấp sẵn mọi quyền), mở app, chụp màn hình, rồi bấm nút "Đăng nhập".
Đăng nhập tester1@gmail.com vào máy ảo 1, sau đó cài com.example.app từ Google Play.
Đọc logcat của com.example.app, lọc dòng có "Exception".
Giới hạn đã biết
type_textchỉ gõ được ký tự ASCII. Muốn gõ tiếng Việt hoặc ký tự khác, cài app ADBKeyboard vào máy ảo; tool sẽ tự chuyển bàn phím khi gõ.Một chuỗi
%snằm trong văn bản cần gõ sẽ bị lệnhinput textcủa Android đổi thành dấu cách.Cài theo tên trên Google Play dựa vào giao diện Play, nên có thể chọn nhầm app hoặc hỏng khi Google đổi giao diện.
Trên LDPlayer 14, lệnh
pull/pushcủaldconsolekhông chạy được, và ảnh máy ảo không có lệnhmonkey. Server dùng thẳngadbvàcmd package resolve-activitythay cho hai lệnh đó.
Nhiều tài khoản, nhiều máy ảo
Ghi mọi tài khoản test vào cùng
accounts.json. Mỗi lần gọigoogle_loginchọn một email.Mỗi máy ảo có thể đăng nhập một tài khoản khác nhau, ví dụ
google_login(email="tester2@gmail.com", target=1).Một máy ảo cũng có thể giữ nhiều tài khoản: gọi
google_loginthêm lần nữa. Xem danh sách bằnggoogle_accounts.Máy ảo có nhiều tài khoản thì Google Play cài app bằng tài khoản đang chọn trong Play. Muốn đổi tài khoản, chạm vào ảnh đại diện trong Play.
Phát triển
.venv\Scripts\pip install -e ".[dev]"
.venv\Scripts\python -m pytestTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Disposable cloud Android emulators for coding agents: run an APK or PR build, tap, type, screenshot.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.945 PyPI2-
- AlicenseBqualityDmaintenanceEnables AI agents to control the Android Emulator through adb, including booting AVDs, installing and managing apps, interacting with the UI, taking screenshots, reading logs, and more.37MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to fully control an Android emulator via MCP, including UI interaction, screenshots, APK installation, logging, and clipboard access, with optional live browser viewing for humans.2MIT
- AlicenseAqualityBmaintenanceEnables AI agents to automate Android and iOS devices, including emulators and physical devices, by capturing screenshots, reading UI accessibility trees, performing touch and text input, and managing app lifecycle and logs.184MIT