MCPcopy
hub / github.com/zai-org/Open-AutoGLM / _get_device_details

Method _get_device_details

phone_agent/xctest/connection.py:115–150  ·  view source on GitHub ↗

Get detailed information about a specific device. Args: udid: Device UDID. Returns: Dictionary with device details.

(self, udid: str)

Source from the content-addressed store, hash-verified

113 return []
114
115 def _get_device_details(self, udid: str) -> dict[str, str]:
116 """
117 Get detailed information about a specific device.
118
119 Args:
120 udid: Device UDID.
121
122 Returns:
123 Dictionary with device details.
124 """
125 try:
126 result = subprocess.run(
127 ["ideviceinfo", "-u", udid],
128 capture_output=True,
129 text=True,
130 timeout=5,
131 )
132
133 info = {}
134 for line in result.stdout.split("\n"):
135 if ": " in line:
136 key, value = line.split(": ", 1)
137 key = key.strip()
138 value = value.strip()
139
140 if key == "ProductType":
141 info["model"] = value
142 elif key == "ProductVersion":
143 info["ios_version"] = value
144 elif key == "DeviceName":
145 info["name"] = value
146
147 return info
148
149 except Exception:
150 return {}
151
152 def get_device_info(self, device_id: str | None = None) -> DeviceInfo | None:
153 """

Callers 1

list_devicesMethod · 0.95

Calls 1

runMethod · 0.45

Tested by

no test coverage detected