From d0f872fc8b87987a7ca1aa793ab9810d34dd8b12 Mon Sep 17 00:00:00 2001 From: ncode Date: Thu, 17 Sep 2026 21:00:52 +0300 Subject: [PATCH] Record two device lessons that cost real time adb shell input tap is not trustworthy on this phone. It produced six rounds of false conclusions in one session, including a confident diagnosis that pointer events were dead which was actually a re-locked screen eating the input. The CSS-to-device mapping is not css times devicePixelRatio: 735 CSS px at dpr 3 is 2205 device px inside a 2460px screen, and the 255px of system bars means the offset must be measured. Two rival offsets both failed. When a known-good control looks dead, check the lock state before suspecting the code. svc power stayon usb writes stay_on_while_plugged_in = 2, and this phone charges over AC, so it silently never engages. stayon true writes 7 and works. The 30s screen timeout is a separate setting. Co-Authored-By: Claude Opus 5 --- CLAUDE.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index df0d97e..4ebd1f9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -211,6 +211,28 @@ fingers routinely lift outside the key they went down on. bugs. The cost is that a mistyped class renders with no class at all rather than failing, which is why the layout is pinned by tests instead. +**Do not trust `adb shell input tap` on this device.** It cost six rounds of +false conclusions in one session: taps that hit a neighbouring key, taps that hit +nothing, and an entire diagnosis of "pointer events are dead" that turned out to +be a re-locked screen swallowing the input. The CSS-to-device mapping is not +simply `css × devicePixelRatio` — the viewport is 735 CSS px at dpr 3 = 2205 +device px inside a 2460px screen, and the remaining 255px of system bars means +the offset has to be measured, not assumed. Two rival offsets both failed. + +When a *known-good* control appears dead, check the lock state before suspecting +the code. For anything touch-related, one report from a person holding the phone +beats an afternoon of synthetic input. + +**Stay awake needs `svc power stayon true`, not `usb`.** The `usb` form writes +`stay_on_while_plugged_in = 2`, and this phone charges over AC (`USB powered: +false`), so it silently never engages — `mStayOn` stays false. `true` writes 7 +(any source) and works. The screen timeout is separate and was 30s: + +``` +adb shell svc power stayon true +adb shell settings put system screen_off_timeout 1800000 # restore: 30000 +``` + **Seeing the UI without the phone.** There is no Chromium on this machine, but Firefox can screenshot headlessly with no extra dependency: