MCPcopy
hub / github.com/mobile-next/mobile-mcp / Robot

Interface Robot

src/robot.ts:48–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46export type Orientation = "portrait" | "landscape";
47
48export interface Robot {
49 /**
50 * Get the screen size of the device in pixels.
51 */
52 getScreenSize(): Promise<ScreenSize>;
53
54 /**
55 * Swipe in a direction.
56 */
57 swipe(direction: SwipeDirection): Promise<void>;
58
59 /**
60 * Swipe from a specific coordinate in a direction.
61 */
62 swipeFromCoordinate(x: number, y: number, direction: SwipeDirection, distance?: number): Promise<void>;
63
64 /**
65 * Get a screenshot of the screen. Returns a Buffer that contains
66 * a PNG image of the screen. Will be same dimensions as getScreenSize().
67 */
68 getScreenshot(): Promise<Buffer>;
69
70 /**
71 * List all installed apps on the device. Returns an array of package names (or
72 * bundle identifiers in iOS) for all installed apps.
73 */
74 listApps(): Promise<InstalledApp[]>;
75
76 /**
77 * Launch an app.
78 */
79 launchApp(packageName: string, locale?: string): Promise<void>;
80
81 /**
82 * Terminate an app. If app was already terminated (or non existent) then this
83 * is a no-op.
84 */
85 terminateApp(packageName: string): Promise<void>;
86
87 /**
88 * Install an app on the device from a file path.
89 */
90 installApp(path: string): Promise<void>;
91
92 /**
93 * Uninstall an app from the device.
94 */
95 uninstallApp(bundleId: string): Promise<void>;
96
97 /**
98 * Open a URL in the device's web browser. Can be an https:// url, or a
99 * custom scheme (e.g. "myapp://").
100 */
101 openUrl(url: string): Promise<void>;
102
103 /**
104 * Send keys to the device, simulating keyboard input.
105 */

Callers 69

ios.tsFile · 0.65
android.tsFile · 0.65
getScreenSizeMethod · 0.65
getScreenSizeMethod · 0.65
createMcpServerFunction · 0.65
swipeMethod · 0.65
swipeMethod · 0.65
createMcpServerFunction · 0.65
swipeFromCoordinateMethod · 0.65
swipeFromCoordinateMethod · 0.65

Implementers 4

Simctlsrc/iphone-simulator.ts
IosRobotsrc/ios.ts
MobileDevicesrc/mobile-device.ts
AndroidRobotsrc/android.ts

Calls

no outgoing calls

Tested by

no test coverage detected