runLongpressCli function

Future<int> runLongpressCli(
  1. List<String> args
)

CLI adapter for fdb longpress. Accepts widget selector flags, coordinate flags, and an optional --duration flag (default 500 ms).

Emits one of: LONG_PRESSED=type X=x Y=y (success) ERROR: fdb_helper not detected in running app. ... (no helper) ERROR: message (error) (AppDiedException rethrown for dispatcher's _formatAppDied) (app died)

Implementation

Future<int> runLongpressCli(List<String> args) async {
  final parser = ArgParser()
    ..addOption('text', help: 'Match widget by text')
    ..addOption('key', help: 'Match widget by key')
    ..addOption('type', help: 'Match widget by type')
    ..addOption('index', help: 'Index when multiple widgets match')
    ..addOption('x', help: 'Absolute X coordinate')
    ..addOption('y', help: 'Absolute Y coordinate')
    ..addOption('at', help: 'Coordinates as x,y (e.g. 200,400)')
    ..addOption('duration', help: 'Hold duration in milliseconds (default: 500)')
    ..addOption('timeout', help: 'Timeout in seconds (default: 5)');

  return runCliAdapter(parser, args, _execute);
}