Android
Requirements
Section titled “Requirements”- Android SDK with platform tools (ADB)
- An Android emulator or connected device
- Flutter app built with
--dart-define=PROBE_AGENT=true
Emulator Setup
Section titled “Emulator Setup”List available devices
Section titled “List available devices”probe device listStart an emulator
Section titled “Start an emulator”probe device start --platform androidOr start manually:
emulator -avd Pixel_7_API_34 -no-snapshot-loadBuild and install your app
Section titled “Build and install your app”flutter build apk --debug --dart-define=PROBE_AGENT=trueadb install -r build/app/outputs/flutter-apk/app-debug.apkadb shell am start -n com.example.myapp/.MainActivityConnection Flow
Section titled “Connection Flow”- The CLI runs
adb forward tcp:<host-port> tcp:<device-port>to bridge the emulator network - The CLI connects via WebSocket to
ws://127.0.0.1:<host-port>/probe?token=... - The auth token is extracted from
adb logcatoutput matchingPROBE_TOKEN= - Once authenticated, the CLI dispatches JSON-RPC commands to the Dart agent
By default, both host and device ports are 48686. For parallel testing, set different host ports per device.
Port Forwarding
Section titled “Port Forwarding”agent: port: 48686 # host-side port device_port: 48686 # on-device port (what ProbeAgent listens on)For parallel testing with multiple devices:
agent: port: 48687 device_port: 48686This maps adb forward tcp:48687 tcp:48686, keeping the device port the same while using a unique host port.
Custom ADB Path
Section titled “Custom ADB Path”If ADB is not on your PATH:
probe test tests/ --adb /path/to/platform-tools/adbOr in probe.yaml:
tools: adb: /path/to/platform-tools/adbPermissions
Section titled “Permissions”Android runtime permissions are granted via adb shell pm grant:
allow permission "camera" # adb shell pm grant <pkg> android.permission.CAMERAdeny permission "location" # adb shell pm revoke <pkg> android.permission.ACCESS_FINE_LOCATIONgrant all permissions # grants all known runtime permissionsAvailable permissions: notifications, camera, location, microphone, storage, contacts, phone, calendar, sms, bluetooth.
Video Recording
Section titled “Video Recording”Android uses the built-in screenrecord command. Videos are recorded as MP4 (H.264). The CLI auto-chains recordings to work around the 180-second limit.
probe test tests/ --video --video-resolution 720x1280 --video-framerate 2If scrcpy is installed, it is used as the preferred backend for higher quality recordings.
If ffmpeg is installed, multi-segment recordings are stitched into a single file. Without it, segments are kept as separate files.
Configuration
Section titled “Configuration”device: emulator_boot_timeout: 120s boot_poll_interval: 2s token_file_retries: 5 restart_delay: 500ms
agent: port: 48686 dial_timeout: 30s ping_interval: 5s token_read_timeout: 30s reconnect_delay: 2s