Skip to content

Add fdb native-tap for tapping native iOS/Android system dialogs #57

@andrzejchm

Description

@andrzejchm

Summary

Tap native (non-Flutter) UI elements: iOS system dialogs (universal-link picker, permission prompts), Android consent sheets and runtime-permission prompts. Today fdb tap dispatches through Flutter's GestureBinding and can't reach UIKit/Android views.

$ fdb native-tap --at 200,400
$ fdb native-tap --text "Allow"          # iOS sim only, via AX

Why

Blocker for any iOS investigation. A fresh sim shows OS dialogs (universal-link picker, Usercentrics consent, push notification prompt, etc.) before the Flutter UI is reachable. Same gap exists on Android for system permission sheets. Without this, the workaround is cliclick (requires macOS Accessibility permission) or manual tapping.

Implementation hints

  • New file: lib/commands/native_tap.dart, exports Future<int> runNativeTap(List<String> args).
  • Branch on platform from readPlatformInfo() in lib/process_utils.dart:
    • Android (any): adb -s <device> shell input tap <x> <y>. Read device id via readDevice(). Coordinates only (Android doesn't expose stable AX text from CLI without uiautomator dump).
    • iOS simulator: xcrun simctl io <udid> sendkey doesn't do taps. Use xcrun simctl io <udid> tap <x> <y> if available, or fall back to an AppleScript via osascript clicking the Simulator window. Document the choice in code comments.
    • iOS physical: out of scope for v1. Print a clear error: ERROR: native-tap on physical iOS not supported. Use idb (https://fbidb.io) for now.
    • macOS: out of scope for v1. Same clear error.
  • v1 supports --at x,y only. --text is iOS-sim-only via AX, defer.
  • The device udid for xcrun simctl is the same id fdb devices reports for iOS sims. Confirm by reading readDevice().

Dos and don'ts

  • Do print clear ERROR: ... with install hint when the underlying tool is missing.
  • Don't try to unify selectors across platforms in v1. Coordinates only.
  • Don't shell out via bash -c. Use Process.start with argv lists per CODE-STYLE.md.
  • Don't add new dependencies.

Acceptance

  • lib/commands/native_tap.dart exists, exports runNativeTap, follows CODE-STYLE.md
  • fdb native-tap --at x,y works on Android via adb shell input tap
  • fdb native-tap --at x,y works on iOS simulator
  • Clear ERROR: ... on physical iOS and macOS pointing at alternatives
  • Registered in bin/fdb.dart:_runCommand and listed in usage
  • task test:native-tap (Android-only is fine for v1)
  • README.md commands table updated
  • skills/using-fdb/SKILL.md updated with iOS dialog dismissal example
  • task analyze passes

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions