Docker-Android:集成 noVNC、MCP Server 与本地 AI Agent 的容器化安卓方案
英文标题:📦 budtmo/docker-android
Docker-Android 是一款面向安卓应用开发与自动化测试的开源 Docker 容器方案,支持内置 noVNC 界面可视化与外部 adb 远程调试。项目最新版本新增了对 HTTP 协议 MCP(Model Context Protocol)Server 以及 AI Agent 的测试版支持,可直接联动 Ollama、vLLM 等本地大语言模型服务端进行交互。该方案兼容 Ubuntu 与 Windows 11 WSL2 硬件加速环境,并提供包含高版本安卓(Android 15-17)与无头运行模式的 Pro 版本,为移动端自动化测试、CI/CD 构建及 AI 自主控制移动设备提供了开箱即用的标准化运行环境。
1.6 KB
53.5 KB
199.9 KB
216.1 KB
115.3 KB
68.4 KB
103.5 KB
中文
Docker-Android 是一款专为安卓生态相关任务构建的 Docker 镜像。它可用于应用程序的开发与测试(包括原生 Native、Web 以及混合 Hybrid 应用)。
赞助商
Proxy-Seller 可为各种工作流提供可靠的代理基础设施:独享住宅代理、移动代理(4G/5G/LTE)、ISP 代理以及数据中心 IPv4/IPv6 代理,全线支持 HTTP(S) 和 SOCKS5 协议。可调取遍布 220 多个地区的 4700 万+ 住宅 IP,精准定位至国家、城市或 ISP,并享有 99.7% 的正常运行时间保障及 24/7 全天候支持。使用优惠码 BUDTMO 即可享受 15% 折扣。
本项目的优势
- 提供多种设备配置文件和外观皮肤的模拟器,例如三星 Galaxy S6、LG Nexus 4、HTC Nexus One 等。
- 支持 VNC,可直观查看 Docker 容器内的运行情况。
- 支持日志共享功能,所有日志均可通过 Web 界面访问。
- 支持通过外部
adb connect直接控制容器内的模拟器。 - 与其他云方案集成,例如 Genymotion Cloud。
- 可用于构建安卓项目。
- 可配合 Appium、Espresso 等不同测试框架运行单元测试和 UI 测试。
- 支持(HTTP)MCP-Server(测试版)。
- 支持 AI-Agent(测试版)——目前支持的本地大语言模型(LLM)服务端包括:Ollama、VLLM。
| Android 版本 | API | 最新发布版本镜像 | 指定发布版本镜像 |
|---|---|---|---|
| 9.0 | 28 | budtmo/docker-android:emulator_9.0 | budtmo/docker-android:emulator_9.0_<release_version> |
| 10.0 | 29 | budtmo/docker-android:emulator_10.0 | budtmo/docker-android:emulator_10.0_<release_version> |
| 11.0 | 30 | budtmo/docker-android:emulator_11.0 | budtmo/docker-android:emulator_11.0_<release_version> |
| 12.0 | 32 | budtmo/docker-android:emulator_12.0 | budtmo/docker-android:emulator_12.0_<release_version> |
| 13.0 | 33 | budtmo/docker-android:emulator_13.0 | budtmo/docker-android:emulator_13.0_<release_version> |
| 14.0 | 34 | budtmo/docker-android:emulator_14.0 | budtmo/docker-android:emulator_14.0_<release_version> |
- | - | budtmo/docker-android:genymotion | budtmo/docker-android:genymotion_<release_version>
- | - | budtmo/docker-android:mcp | budtmo/docker-android:mcp_<release_version>
| 类型 | 设备名称 |
|---|---|
| 手机 | Samsung Galaxy S10 |
| 手机 | Samsung Galaxy S9 |
| 手机 | Samsung Galaxy S8 |
| 手机 | Samsung Galaxy S7 Edge |
| 手机 | Samsung Galaxy S7 |
| 手机 | Samsung Galaxy S6 |
| 手机 | Nexus 4 |
| 手机 | Nexus 5 |
| 手机 | Nexus One |
| 手机 | Nexus S |
| 平板 | Nexus 7 |
| 平板 | Pixel C |
-
系统中需已安装 Docker。
-
如果主机使用的是 Ubuntu 操作系统,可以直接跳过此步。对于 OSX 和 Windows 操作系统 用户,需要使用支持虚拟化的虚拟机安装 Ubuntu 系统运行,因为该镜像仅支持在 Ubuntu 系统下运行。
-
机器需支持硬件虚拟化。检查虚拟化是否已启用的命令如下:
sudo apt install cpu-checker kvm-ok -
运行 Docker-Android 容器:
docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0 -
打开 http://localhost:6080 查看正在运行的容器内部界面。
-
检查模拟器状态:
docker exec -it android-container cat device_status
容器默认会在重启时销毁模拟设备。如果需要持久化数据,需要将卷挂载到 /home/androidusr:docker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0
WSL2 硬件加速(仅限 Windows 11)
鸣谢 Guillaume - The Parallel Interface 博客
-
将当前用户添加到
kvm用户组:sudo usermod -a -G kvm ${USER} -
在
/etc/wsl.conf对应小节下添加必要标识:[boot] command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'
接下来,使用 PowerShell 通过记事本打开配置文件:notepad $env:USERPROFILE\.wslconfig。在文件中填入以下配置标识:
[wsl2]
nestedVirtualization=true
- 通过 CMD 命令提示符或 PowerShell 重启 WSL2
command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm' 会在 WSL2 启动时将 /dev/kvm 归属于 kvm 用户组,而非默认的 root 用户组。
nestedVirtualization(嵌套虚拟化)标识仅在 Windows 11 上可用。
如果此配置不起作用,说明当前 WSL 版本较旧。此时可忽略 \.wslconfig,将所有配置直接填入 /etc/wsl.conf 中,包括 [wsl2] 标识小节。
使用场景与文档
这份配置文件文档包含了用于开启特定功能(如日志共享等)的详细配置说明。
如果缺乏维护模拟器的资源、无预算采购机器,或需要不同设备配置文件,可以尝试使用 Genymotion SAAS。Docker-Android 已在多个云平台上与 Genymotion 实现集成,包括 Genymotion SAAS、AWS、GCP、阿里云等。详情请参考此文档。
模拟器外观皮肤提取自 Android Studio IDE 和 Samsung Developer Website。
Docker-Android-Pro
由于技术支持求助量极大,为了能够持续积极地维护本项目,作者推出了 docker-android-pro。Docker-Android-Pro 是一个基于赞助的项目,只有活跃赞助者才能拉取 Pro 版本的 Docker 镜像。
标准版与 Pro 版本的差异如下:
| 功能特性 | 标准版 | Pro 版 | 备注说明 |
|---|---|---|---|
| 用户行为分析(user-behavior-analytics) | 支持 | 不包含 | - |
| AI-Agent | 不支持 | 支持 | 目前支持的本地 LLM 服务端:Ollama、VLLM |
| 代理配置(proxy) | 不支持 | 支持 | 支持在运行时动态为安卓模拟器配置企业代理 |
| 语言设置(language) | 不支持 | 支持 | 支持在运行时动态设置安卓模拟器系统语言 |
| 更新的安卓版本 | 不支持 | 支持 | 支持更新的安卓版本,例如 Android 15、Android 16、Android 17 等 |
| Root 权限 | 不支持 | 支持 | 支持以安全特权权限执行命令 |
| 无头模式(headless-mode) | 不支持 | 支持 | 通过无头模式节约系统资源 |
| Selenium 4.x 集成 | 不支持 | 支持 | 针对单个(Selenium Hub)端点运行 Appium UI 测试,适用于 Android 和 iOS 模拟器/真实设备 |
| 多安卓模拟器并发 | 不支持 | 即将支持 | 在单个 Docker 容器内运行多个安卓模拟器以节省资源 |
| Google Play Store | 不支持 | 即将支持 | - |
| 屏幕录制(Video Recording) | 不支持 | 即将支持 | 便于调试排错 |
Pro 版本镜像列表:
| Android 版本 | API | 类型 | 最新发布版本镜像 | 指定发布版本镜像 |
|---|---|---|---|---|
| 9.0 | 28 | 标准 | budtmo2/docker-android-pro:emulator_9.0 | budtmo2/docker-android-pro:emulator_9.0_<release_version> |
| 10.0 | 29 | 标准 | budtmo2/docker-android-pro:emulator_10.0 | budtmo2/docker-android-pro:emulator_10.0_<release_version> |
| 11.0 | 30 | 标准 | budtmo2/docker-android-pro:emulator_11.0 | budtmo2/docker-android-pro:emulator_11.0_<release_version> |
| 12.0 | 32 | 标准 | budtmo2/docker-android-pro:emulator_12.0 | budtmo2/docker-android-pro:emulator_12.0_<release_version> |
| 13.0 | 33 | 标准 | budtmo2/docker-android-pro:emulator_13.0 | budtmo2/docker-android-pro:emulator_13.0_<release_version> |
| 14.0 | 34 | 标准 | budtmo2/docker-android-pro:emulator_14.0 | budtmo2/docker-android-pro:emulator_14.0_<release_version> |
| 15.0 | 35 | 标准 | budtmo2/docker-android-pro:emulator_15.0 | budtmo2/docker-android-pro:emulator_15.0_<release_version> |
| 16.0 | 36 | 标准 | budtmo2/docker-android-pro:emulator_16.0 | budtmo2/docker-android-pro:emulator_16.0_<release_version> |
| 17.0 | 37 | 标准 | budtmo2/docker-android-pro:emulator_17.0 | budtmo2/docker-android-pro:emulator_17.0_<release_version> |
| 9.0 | 28 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_9.0 | budtmo2/docker-android-pro:emulator_headless_9.0_<release_version> |
| 10.0 | 29 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_10.0 | budtmo2/docker-android-pro:emulator_headless_10.0_<release_version> |
| 11.0 | 30 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_11.0 | budtmo2/docker-android-pro:emulator_headless_11.0_<release_version> |
| 12.0 | 32 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_12.0 | budtmo2/docker-android-pro:emulator_headless_12.0_<release_version> |
| 13.0 | 33 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_13.0 | budtmo2/docker-android-pro:emulator_headless_13.0_<release_version> |
| 14.0 | 34 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_14.0 | budtmo2/docker-android-pro:emulator_headless_14.0_<release_version> |
| 15.0 | 35 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_15.0 | budtmo2/docker-android-pro:emulator_headless_15.0_<release_version> |
| 16.0 | 36 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_16.0 | budtmo2/docker-android-pro:emulator_headless_16.0_<release_version> |
| 17.0 | 37 | 无头(Headless) | budtmo2/docker-android-pro:emulator_headless_17.0 | budtmo2/docker-android-pro:emulator_headless_17.0_<release_version> |
- | - | AI-Agent | budtmo2/docker-android-pro:agent | budtmo2/docker-android-pro:agent_<release_version>
- | - | Selenium | budtmo2/docker-android-pro:selenium | budtmo2/docker-android-pro:selenium_<release_version>
有关如何使用 docker-android-pro 的详细说明,请参阅此文档。
English / 原文
Docker-Android is a docker image built to be used for everything related to Android. It can be used for Application development and testing (native, web and hybrid-app).
Sponsors
Proxy-Seller gives you reliable proxy infrastructure for any workflow: private residential, mobile (4G/5G/LTE), ISP, and datacenter IPv4/IPv6 proxies, all with HTTP(S) and SOCKS5 support. Tap into 47M+ residential IPs across 220+ locations, target exactly the country, city, or ISP you need, and count on 99.7% uptime backed by 24/7 support. Get 15% off with promo code BUDTMO.
Advantages of using this project
- Emulator with different device profile and skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
- Support vnc to be able to see what happen inside docker container
- Support log sharing feature where all logs can be accessed from web-UI
- Ability to control emulator from outside container by using adb connect
- Integrated with other cloud solutions, e.g. Genymotion Cloud
- It can be used to build Android project
- It can be used to run unit and UI-Test with different test-frameworks, e.g. Appium, Espresso, etc.
- It support (http) MCP-Server (beta-version)
- It support AI-Agent (beta-version) - supported local-LLM server: Ollama, VLLM
| Android | API | Image with latest release version | Image with specific release version |
|---|---|---|---|
| 9.0 | 28 | budtmo/docker-android:emulator_9.0 | budtmo/docker-android:emulator_9.0_<release_version> |
| 10.0 | 29 | budtmo/docker-android:emulator_10.0 | budtmo/docker-android:emulator_10.0_<release_version> |
| 11.0 | 30 | budtmo/docker-android:emulator_11.0 | budtmo/docker-android:emulator_11.0_<release_version> |
| 12.0 | 32 | budtmo/docker-android:emulator_12.0 | budtmo/docker-android:emulator_12.0_<release_version> |
| 13.0 | 33 | budtmo/docker-android:emulator_13.0 | budtmo/docker-android:emulator_13.0_<release_version> |
| 14.0 | 34 | budtmo/docker-android:emulator_14.0 | budtmo/docker-android:emulator_14.0_<release_version> |
-
| - | budtmo/docker-android:genymotion | budtmo/docker-android:genymotion_<release_version>
-
| - | budtmo/docker-android:mcp | budtmo/docker-android:mcp_<release_version>
Type | Device Name
---|---
Phone | Samsung Galaxy S10
Phone | Samsung Galaxy S9
Phone | Samsung Galaxy S8
Phone | Samsung Galaxy S7 Edge
Phone | Samsung Galaxy S7
Phone | Samsung Galaxy S6
Phone | Nexus 4
Phone | Nexus 5
Phone | Nexus One
Phone | Nexus S
Tablet | Nexus 7
Tablet | Pixel C-
Docker is installed on your system.
-
If you use Ubuntu OS on your host machine, you can skip this step. For OSX and Windows OS user, you need to use Virtual Machine that support Virtualization with Ubuntu OS because the image can be run under Ubuntu OS only.
-
Your machine should support virtualization. To check if the virtualization is enabled is:
sudo apt install cpu-checker kvm-ok -
Run Docker-Android container
docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0 -
Open http://localhost:6080 to see inside running container.
-
To check the status of the emulator
docker exec -it android-container cat device_status
-
The default behaviour is to destroy the emulated device on container restart. To persist data, you need to mount a volume at /home/androidusr: docker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0
WSL2 Hardware acceleration (Windows 11 only)
Credit goes to Guillaume - The Parallel Interface blog
Microsoft - Advanced settings configuration in WSL
-
Add yourself to the
kvmusergroup.sudo usermod -a -G kvm ${USER} -
Add necessary flags to
/etc/wsl.confto their respective sections.[boot] command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'
Then, using PowerShell, open a notepad on notepad $env:USERPROFILE\.wslconfig. Inside, put these other flags:
[wsl2]
nestedVirtualization=true
- Restart WSL2 via CMD prompt or Powershell
command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm' sets /dev/kvm to kvm usergroup rather than the default root usergroup on WSL2 startup.
nestedVirtualization flag is only available to Windows 11.
If this setup does not work, you may have an old WSL version. In that case, ignore \.wslconfig and put everything on /etc/wsl.conf, including the [wsl2] flag.
- Build Android project
- UI-Test with Appium
- Control Android emulator on host machine
- SMS Simulation
- Jenkins
- Deploying on cloud (Azure, AWS, GCP)
This document contains information about configurations that can be used to enable some features, e.g. log-sharing, etc.
For you who do not have ressources to maintain the simulator or to buy machines or need different device profiles, you can give a try by using Genymotion SAAS. Docker-Android is integrated with Genymotion on different cloud services, e.g. Genymotion SAAS, AWS, GCP, Alibaba Cloud. Please follow this document for more detail.
The Emulator skins are taken from Android Studio IDE and Samsung Developer Website
Due to high requests for help and to be able to actively maintain the projects, the creator has decided to create docker-android-pro. Docker-Android-Pro is a sponsor based project which mean that the docker image of pro-version can be pulled only by active sponsor.
The differences between normal version and pro version are:
| Feature | Normal | Pro | Comment |
|---|---|---|---|
| user-behavior-analytics | Yes | No | - |
| ai-agent | No | Yes | Currently supported local-LLM server: Ollama, VLLM |
| proxy | No | Yes | Set up company proxy on Android emulator on fly |
| language | No | Yes | Set up language on Android emulator on fly |
| Newer Android version | No | Yes | Support other newer Android version e.g. Android 15, Android 16, Android 17, etc |
| root-privileged | No | Yes | Able to run command with security privileged |
| headless-mode | No | Yes | Save resources by using headless mode |
| Selenium 4.x integration | No | Yes | Running Appium UI-Tests againt one (Selenium Hub) endpoint for Android- and iOS emulator(s) / device(s) |
| multiple Android-Simulators | No | Yes (soon) | Save resources by having multiple Android-Simulators on one docker-container |
| Google Play Store | No | Yes (soon) | - |
| Video Recording | No | Yes (soon) | Helpful for debugging |
List pro-version images:
| Android | API | Type | Image with latest release version | Image with specific release version |
|---|---|---|---|---|
| 9.0 | 28 | Normal | budtmo2/docker-android-pro:emulator_9.0 | budtmo2/docker-android-pro:emulator_9.0_<release_version> |
| 10.0 | 29 | Normal | budtmo2/docker-android-pro:emulator_10.0 | budtmo2/docker-android-pro:emulator_10.0_<release_version> |
| 11.0 | 30 | Normal | budtmo2/docker-android-pro:emulator_11.0 | budtmo2/docker-android-pro:emulator_11.0_<release_version> |
| 12.0 | 32 | Normal | budtmo2/docker-android-pro:emulator_12.0 | budtmo2/docker-android-pro:emulator_12.0_<release_version> |
| 13.0 | 33 | Normal | budtmo2/docker-android-pro:emulator_13.0 | budtmo2/docker-android-pro:emulator_13.0_<release_version> |
| 14.0 | 34 | Normal | budtmo2/docker-android-pro:emulator_14.0 | budtmo2/docker-android-pro:emulator_14.0_<release_version> |
| 15.0 | 35 | Normal | budtmo2/docker-android-pro:emulator_15.0 | budtmo2/docker-android-pro:emulator_15.0_<release_version> |
| 16.0 | 36 | Normal | budtmo2/docker-android-pro:emulator_16.0 | budtmo2/docker-android-pro:emulator_16.0_<release_version> |
| 17.0 | 37 | Normal | budtmo2/docker-android-pro:emulator_17.0 | budtmo2/docker-android-pro:emulator_17.0_<release_version> |
| 9.0 | 28 | Headless | budtmo2/docker-android-pro:emulator_headless_9.0 | budtmo2/docker-android-pro:emulator_headless_9.0_<release_version> |
| 10.0 | 29 | Headless | budtmo2/docker-android-pro:emulator_headless_10.0 | budtmo2/docker-android-pro:emulator_headless_10.0_<release_version> |
| 11.0 | 30 | Headless | budtmo2/docker-android-pro:emulator_headless_11.0 | budtmo2/docker-android-pro:emulator_headless_11.0_<release_version> |
| 12.0 | 32 | Headless | budtmo2/docker-android-pro:emulator_headless_12.0 | budtmo2/docker-android-pro:emulator_headless_12.0_<release_version> |
| 13.0 | 33 | Headless | budtmo2/docker-android-pro:emulator_headless_13.0 | budtmo2/docker-android-pro:emulator_headless_13.0_<release_version> |
| 14.0 | 34 | Headless | budtmo2/docker-android-pro:emulator_headless_14.0 | budtmo2/docker-android-pro:emulator_headless_14.0_<release_version> |
| 15.0 | 35 | Headless | budtmo2/docker-android-pro:emulator_headless_15.0 | budtmo2/docker-android-pro:emulator_headless_15.0_<release_version> |
| 16.0 | 36 | Headless | budtmo2/docker-android-pro:emulator_headless_16.0 | budtmo2/docker-android-pro:emulator_headless_16.0_<release_version> |
| 17.0 | 37 | Headless | budtmo2/docker-android-pro:emulator_headless_17.0 | budtmo2/docker-android-pro:emulator_headless_17.0_<release_version> |
- | - | AI-Agent | budtmo2/docker-android-pro:agent | budtmo2/docker-android-pro:agent_<release_version>
- | - | Selenium | budtmo2/docker-android-pro:selenium | budtmo2/docker-android-pro:selenium_<release_version>
This document contains detail information about how to use docker-android-pro.
See License

