MCPcopy Index your code
hub / github.com/callstack/agent-device / getAndroidScreenSize

Function getAndroidScreenSize

src/platforms/android/input-actions.ts:288–295  ·  view source on GitHub ↗
(
  device: DeviceInfo,
)

Source from the content-addressed store, hash-verified

286}
287
288export async function getAndroidScreenSize(
289 device: DeviceInfo,
290): Promise<{ width: number; height: number }> {
291 const result = await runAndroidAdb(device, ['shell', 'wm', 'size']);
292 const match = result.stdout.match(/Physical size:\s*(\d+)x(\d+)/);
293 if (!match) throw new AppError('COMMAND_FAILED', 'Unable to read screen size');
294 return { width: Number(match[1]), height: Number(match[2]) };
295}
296
297const ANDROID_INPUT_TEXT_CHUNK_SIZE = 8;
298

Callers 3

resolveGestureCenterFunction · 0.90
scrollAndroidFunction · 0.85

Calls 1

runAndroidAdbFunction · 0.90

Tested by

no test coverage detected