Files
Michał Pierzchała c72cf0e1d2 fix: clarify Android gesture transform behavior (#584)
* fix: clarify Android gesture transform behavior

* fix: stabilize Android transform injection
2026-05-26 09:47:07 +02:00
..

Android MultiTouch Helper

Small instrumentation APK used to inject Android two-pointer gestures through UiAutomation.injectInputEvent. The helper accepts a compact base64 JSON payload so local ADB, remote ADB tunnels, and remote providers that allow adb install -t plus am instrument can use the same contract.

The helper is separate from android-snapshot-helper because the payload and output protocol are gesture-specific. The install/version/cache lifecycle should stay aligned with the snapshot helper.

Build

VERSION="$(node -p 'require("./package.json").version')"
sh ./scripts/build-android-multitouch-helper.sh "$VERSION" .tmp/android-multitouch-helper

Run

PAYLOAD="$(printf '%s' '{"kind":"transform","x":672,"y":1500,"dx":80,"dy":-40,"scale":1.8,"degrees":35,"durationMs":700}' | base64)"
adb install -r -t ".tmp/android-multitouch-helper/agent-device-android-multitouch-helper-$VERSION.apk"
adb shell am instrument -w \
  -e payloadBase64 "$PAYLOAD" \
  com.callstack.agentdevice.multitouchhelper/.MultiTouchInstrumentation

Output Contract

The APK emits instrumentation result records using agentDeviceProtocol=android-multitouch-helper-v1.

Successful results include:

  • ok=true
  • helperApiVersion=1
  • kind (pinch, rotate, or transform)
  • injectedEvents
  • elapsedMs

Failures return ok=false, errorType, and message.