INNER CODE UNIT · Python
_is_emulator
CursorTouch/Android-MCP · src/android_mcp/__main__.py:116
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-")
def _pick_auto_device(connection: str) -> Optional[str]:
devices = Mobile.list_devices()
online = [serial for serial, state in devices if state == "device"]
if not online:
return None
if connection == "wifi":