Skip to content

Cannot connect to a real device. Emulator works #14

@prameshbajra

Description

@prameshbajra

I have this in my ~/Library/Application Support/Claude/claude_desktop_config.json. I tried both uvx and local development mode.

{
  "mcpServers": {
    "android-mcp": {
      "command": "uvx",
      "args": [
        "android-mcp",
        "--device", "my device ID I got from adb devices"
      ]
    }
  }
  "preferences": {
    ... my preferences
  }
}

But claude cannot connect to it. I gives this error

Traceback (most recent call last):
  File "/<homepath>/Library/Application Support/Claude/Claude Extensions/ant.dir.gh.cursortouch.android-mcp/src/android_mcp/mobile/service.py", line 11, in __init__
    self.device = u2.connect(device)
                  ~~~~~~~~~~^^^^^^^^
  File "/<homepath>/Library/Application Support/Claude/Claude Extensions/ant.dir.gh.cursortouch.android-mcp/.venv/lib/python3.13/site-packages/uiautomator2/__init__.py", line 946, in connect
    return connect_usb(serial)
  File "/<homepath>/Library/Application Support/Claude/Claude Extensions/ant.dir.gh.cursortouch.android-mcp/.venv/lib/python3.13/site-packages/uiautomator2/__init__.py", line 962, in connect_usb
    return Device(serial)
  File "/<homepath>/Library/Application Support/Claude/Claude Extensions/ant.dir.gh.cursortouch.android-mcp/.venv/lib/python3.13/site-packages/uiautomator2/base.py", line 36, in __init__
    self._dev = self._wait_for_device()
                ~~~~~~~~~~~~~~~~~~~~~^^
  File "/<homepath>/Library/Application Support/Claude/Claude Extensions/ant.dir.gh.cursortouch.android-mcp/.venv/lib/python3.13/site-packages/uiautomator2/base.py", line 79, in _wait_for_device
    raise ConnectError(f"device {self._serial} not online")
uiautomator2.exceptions.ConnectError: device emulator-5554 not online

Can you please take a look at this?

Thank you 🙏🏽

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions