AutoMobile - Android automation MCP server with ADB
10K+
This project includes Docker support for running AutoMobile in a containerized environment with all required Android development tools.
To use this Docker image with MCP clients, see the MCP Client Configuration Guide for complete setup instructions.
Quick example for Claude Desktop:
{
"mcpServers": {
"auto-mobile": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "--privileged", "--network", "host", "auto-mobile:latest"]
}
}
}
# Build the image
docker-compose build
# Run in production mode
docker-compose up auto-mobile
# Run in development mode (with auto-reload)
docker-compose up auto-mobile-dev
Published images are available on Docker Hub: kaeawc/auto-mobile
# Pull latest version
docker pull kaeawc/auto-mobile:latest
# Pull specific version
docker pull kaeawc/auto-mobile:0.0.7
# Pull major.minor version (recommended for stability)
docker pull kaeawc/auto-mobile:0.0
# Pull specific commit
docker pull kaeawc/auto-mobile:main-abc1234
For maintainers: See Docker Hub Setup Guide for publishing credentials and workflow configuration.
The Docker image contains:
To include Android emulator/system images, build with:
docker build --platform=linux/amd64 --build-arg ANDROID_INSTALL_EMULATOR=true -t auto-mobile:latest .
# Interactive shell
docker-compose exec auto-mobile bash
# Run tests
docker-compose exec auto-mobile npm test
# Run linter
docker-compose exec auto-mobile npm run lint
# Check connected devices
docker-compose exec auto-mobile adb devices
# Build Android components
docker-compose exec auto-mobile bash -c "cd android && ./gradlew build"
For complete documentation, see docs/docker.md
--platform=linux/amd64 on Apple Silicon.When the image is built without the emulator (ANDROID_INSTALL_EMULATOR=false), use the host emulator setup for
your OS so the container can access your installed AVDs and running emulators.
Linux (host SDK + emulator inside container):
docker run --platform=linux/amd64 -it --rm --name auto-mobile \
--network host \
-e ANDROID_HOME=/opt/android-sdk \
-e ANDROID_SDK_ROOT=/opt/android-sdk \
-e AUTOMOBILE_EMULATOR_HEADLESS=true \
-v "$HOME/Android/Sdk:/opt/android-sdk" \
-v "$HOME/.android:/home/automobile/.android" \
-v "$HOME/.auto-mobile:/home/automobile/.auto-mobile" \
auto-mobile:latest
macOS (host emulator, container auto-connects via ADB):
docker run --platform=linux/amd64 -it --rm --name auto-mobile \
-e ANDROID_HOME=/opt/android-sdk \
-e ANDROID_SDK_ROOT=/opt/android-sdk \
-e AUTOMOBILE_EMULATOR_EXTERNAL=true \
-v "$HOME/.android:/home/automobile/.android" \
-v "$HOME/.auto-mobile:/home/automobile/.auto-mobile" \
auto-mobile:latest
With AUTOMOBILE_EMULATOR_EXTERNAL=true, the container automatically connects to host emulators running on
host.docker.internal:5555-5585. The auto-connect service scans for emulators every 10 seconds and reconnects
when emulators restart. No manual adb connect required.
Do not mount the macOS SDK into /opt/android-sdk (macOS binaries will not run in the Linux container).
Environment variables for auto-connect:
| Variable | Default | Description |
|---|---|---|
AUTOMOBILE_EMULATOR_EXTERNAL | false | Enable external/host emulator mode with auto-connect |
AUTOMOBILE_HOST_GATEWAY | host.docker.internal | Hostname to connect to host emulators |
AUTOMOBILE_EMULATOR_SCAN_INTERVAL_MS | 10000 | How often to scan for new emulators (ms) |
AUTOMOBILE_EMULATOR_PORT_START | 5555 | First emulator ADB port to scan |
AUTOMOBILE_EMULATOR_PORT_END | 5585 | Last emulator ADB port to scan |
For full ADB command support (including adb emu kill and other console commands), you can connect the container to the host's ADB server instead of individual device ports:
# On the host, ensure ADB server is running
adb start-server
# Run container with ADB server tunnel
docker run --platform=linux/amd64 -it --rm --name auto-mobile \
-e ANDROID_HOME=/opt/android-sdk \
-e ANDROID_SDK_ROOT=/opt/android-sdk \
-e AUTOMOBILE_EMULATOR_EXTERNAL=true \
-e AUTOMOBILE_ADB_SERVER_HOST=host.docker.internal \
-e AUTOMOBILE_ADB_SERVER_PORT=5037 \
-v "$HOME/.android:/home/automobile/.android" \
-v "$HOME/.auto-mobile:/home/automobile/.auto-mobile" \
auto-mobile:latest
Benefits of ADB Server Tunnel:
emu kill, etc.)| Variable | Default | Description |
|---|---|---|
AUTOMOBILE_ADB_SERVER_HOST | (none) | Host's ADB server address (enables tunnel mode when set) |
AUTOMOBILE_ADB_SERVER_PORT | 5037 | Host's ADB server port |
For starting/stopping emulators and running SDK commands from within the container, run the host control daemon on your macOS host:
# Start the host control daemon (runs on port 15037)
node scripts/docker/host-control-daemon.js
# Or with custom settings
node scripts/docker/host-control-daemon.js --port 15037 --host 0.0.0.0
The daemon provides a JSON-RPC interface for:
list-avds - List available AVDsstart-emulator - Start an emulator by AVD namestop-emulator - Stop an emulatorlist-running - List running emulatorsavdmanager - Run avdmanager commandssdkmanager - Run sdkmanager commandsRun the container with host control:
docker run --platform=linux/amd64 -it --rm --name auto-mobile \
-e AUTOMOBILE_EMULATOR_EXTERNAL=true \
-e AUTOMOBILE_HOST_CONTROL_HOST=host.docker.internal \
-e AUTOMOBILE_HOST_CONTROL_PORT=15037 \
-v "$HOME/.android:/home/automobile/.android" \
-v "$HOME/.auto-mobile:/home/automobile/.auto-mobile" \
auto-mobile:latest
| Variable | Default | Description |
|---|---|---|
AUTOMOBILE_HOST_CONTROL_HOST | host.docker.internal | Host control daemon address |
AUTOMOBILE_HOST_CONTROL_PORT | 15037 | Host control daemon port |
AUTOMOBILE_HOST_CONTROL_ENABLED | true | Set to false to disable host control integration |
adb devicesadb kill-server && adb start-server--privileged flag# Clean and rebuild
docker-compose down -v
docker-compose build --no-cache
docker-compose up
# Lint Dockerfile
./scripts/docker/validate_dockerfile.sh
# Run container structure tests
./scripts/docker/test_container.sh
# Test host emulator access from the slim image (auto-starts host emulator if needed)
./scripts/docker/test_host_emulator_mcp.sh
# Build image
docker build --platform=linux/amd64 -t auto-mobile:latest .
# Test stdio communication
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | docker run --platform=linux/amd64 -i --rm --init auto-mobile:latest
For more help, see the full Docker documentation and MCP configuration guide.
Content type
Image
Digest
sha256:478fe9adf…
Size
955.9 MB
Last updated
8 months ago
docker pull kaeawc/auto-mobile