Skip to content

[Bug]: Taps do nothing on an Android emulator turned on its side while the app stays portrait #42877

Backlog

Description

@ipanasenko

Note

🤖 Written by Claude Opus 5.5 on behalf of Illia

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Device panel (Android emulators, serve-emu in expo-device-hub 0.26.1)

Steps to reproduce

  1. Open a Pixel 7 API 34 emulator in the Device panel.
  2. Use Rotate device → Landscape while the home screen (portrait-locked launcher) is showing.
  3. The emulator is now physically landscape (adb emu sensor get acceleration → 9.81:0:0) while Android's display stays portrait (dumpsys display viewport orientation=0). The stream shows the portrait UI turned on its side.
  4. Tap any app icon in the panel.

Expected behavior

The tap lands on the icon under the pointer.

Actual behavior

Nothing happens. With Android's pointer-location overlay on, no touch registers anywhere on screen. This happens with serve-emu's default inputSource: "scrcpy" and with inputSource: "grpc", and with or without a wm size override.

Cause (from reading serve-emu 0.26.1)

serve-emu scales normalized touches by the native touch size it reads from the emulator screenshot (grpc-session.js, nativeTouchSize). In this state that screenshot is landscape (2400x1080). Android expects coordinates in the portrait display space (1080x2400), so a tap at normalized x = 0.6 becomes x = 1449, past the 1080 px display width, and is dropped. The client cannot correct for it because serve-emu rejects normalized values outside 0..1. The fix likely belongs in expo-device-hub's input mapping (map frame coordinates through the emulator's physical rotation), with any T3 Code side follow-up after a hub bump.

Impact

Major degradation or frequent failure: the emulator cannot be used by touch until it is rotated back.

Version or commit

Found while working on fix/simulator-fill-foldable-screen (base c478fde); serve-emu from expo-device-hub 0.26.1.

Environment

macOS, local device host, Android Emulator API 34 (Pixel 7 and Pixel Fold AVDs).

Workaround

Rotate the emulator back to portrait from the Device panel, or open an app that supports landscape.

Activity

  1. added
    vouch:trusted
    on Nov 25, 2026
  2. ipanasenko commented on Nov 25, 2026

    @ipanasenko
    ContributorAuthor

    Note

    🤖 Written by Claude Opus 5.5 on behalf of Illia

    The fix belongs in the hub: expo/expo-device-hub#663 (draft).

    Confirmed cause: the gRPC frame is the panel turned by the emulator's physical rotation, gRPC sendTouch takes unrotated panel pixels, and scrcpy injects in Android's display pixels. serve-emu treated all three as one. The same bug also breaks gRPC input in any app that rotates with a turned emulator, and scrcpy input after the hub's own POST /api/orientation lock.

    T3 Code can't work around it on its side. The client can't send the needed values, because serve-emu rejects coordinates outside 0..1. Switching Rotate to user-rotation lock would only produce the mirror case.

    Verified on a Pixel 7 API 34 emulator with both input sources. In all four poses, tapping the Phone icon on the launcher starts the dialer, and swipe traces are correct in both mismatch cases.

    T3 follow-up once a hub release includes it: bump the hub. If the wm size touch compensation in SCRCPY_DISPLAY_TOUCH_HUBS has landed by then, keep it for the new version, because expo/expo-device-hub#663 does not change wm size scaling. Recheck its turned-frame touch mapping too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions