Implementation
@override
Tool get definition => Tool(
name: 'attach',
description:
'Connect to a running Flutter debug app; call once first. All args optional: with none, glint finds the app, its platform and the exact device it runs on. A `device` that does not host the app is refused. With nothing running it lists earlier launches to start from. The reply carries device and app identity, hardwareButtons, screen and the input setup. Attaching a second app pools it; re-attaching by `app` or `device` switches instantly.',
inputSchema: ObjectSchema(
properties: {
'app': Schema.string(
description: 'App to attach or switch to: display name, package, bundle '
'id, or the simulator name it runs on. Matches running apps '
'and already-attached ones.',
),
'vmUri': Schema.string(
description: 'VM service URI, e.g. ws://127.0.0.1:1234/abc=/ws. Omit to '
'auto-discover the running app.',
),
'platform': Schema.string(
description: 'ios | android. Omit to derive from the VM.',
),
'mode': Schema.string(
description: 'flutter | device | auto (default). device = drive the sim '
'with no Flutter app.',
),
'device': Schema.string(
description:
'iOS simulator UDID, Android serial or AVD name (booted when not running). Omit to use the device the app runs on. A device from the "no app running" list starts its app there.',
),
'launch': Schema.string(
description:
'Flutter project folder to build and run, or an installed app id (bundle id or package) to reopen in seconds without a rebuild; one already running on an iOS simulator is brought to the front and attached.',
),
'iosBridgePath': Schema.string(
description: 'Path to compiled `glint-iossim` binary. iOS only.',
),
'camera': Schema.string(
description:
'webcam: when attach boots an AVD by name, its front camera is the Mac camera (the built-in one, not a '
'Continuity iPhone); the back keeps the AVD\'s own. macOS must allow the emulator to use the camera.',
),
'iosBackend': Schema.string(
description: 'bridge (default) | xctest: where simulator input goes. xctest sends it through '
"glint's XCUITest runner, built once per Xcode. Either way get_scene reads native screens and "
'system alerts through that runner (started in the background), unless config iosNativeRunner is false. '
'iOS simulator.',
),
'input': Schema.string(
description: 'auto | app | device: where gestures go. app = inside the Flutter app; device = real '
'touches (system prompts, keyboards, other apps too); auto = app first, device for the rest. '
'Default auto. Replies say which in data.input.',
),
'iosInput': Schema.string(
description:
"auto (default) | dtuhid | indigo: the simulator's real-touch transport; auto picks dtuhid where Xcode ships it.",
),
'signingTeam': Schema.string(
description:
'Apple team id to sign a physical-iPhone build with, when attach launch: should not choose. iOS phones only.',
),
'androidInput': Schema.string(
description: "auto (default) | server | adb. server = glint's resident input server. Android only.",
),
'adbPath': Schema.string(
description: 'adb executable path. Android only.',
),
'returnScene': Schema.bool(
description: 'Include the first get_scene render. Default false.',
),
'dryRun': Schema.bool(
description: 'List attachable apps + devices without attaching. '
'Default false.',
),
'awaitSettle': Schema.bool(
description: 'Wait until the UI settles before returning. Default false.',
),
'observe': Schema.bool(
description:
'Attach for reading only, for an app on a device a person is using: get_scene, logs, screenshots, watch and wait_for work; taps, typing, scrolls, hot_reload and anything else that changes the app are refused (observeOnly). Takes no device claim and arms a watch for new app errors. Default false.',
),
'showTouches': Schema.bool(
description:
'Draw each touch (dot, trail, release ripple) for people watching or recording: in the Flutter '
'app, and system-wide on an Android emulator. Omit to keep the current setting (off by default); config key '
'showTouches toggles it.',
),
},
),
);