INNER CODE UNIT · Python
_format_available_devices
CursorTouch/Android-MCP · src/android_mcp/__main__.py:107
def _format_available_devices() -> str:
devices = Mobile.list_devices()
online = [(serial, state) for serial, state in devices if state == "device"]
if not online:
return ""
formatted = ", ".join(serial for serial, _ in online)
return f" Available devices: {formatted}."
def _is_emulator(serial: str) -> bool:
"""Return True if the serial identifies an Android emulator rather than a physical device.
Emulator serials produced by the Android Emulator always begin with "emulator-"
(e.g. "emulator-5554"). Physical devices connected via USB have alphanumeric
serials (e.g. "RFCW70CZWKV"); physical devices connected via TCP/IP (Wi-Fi ADB)
contain a colon (e.g. "192.168.1.10:5555").
"""
return serial.startswith("emulator-")