feat(dev): ask the phone instead of looking at it
The device tier could only take a screenshot and read what Go chose to log, and a screenshot cannot tell a dropped CSS declaration from a missing asset. This adds the third thing: the page's own answer, from the engine that is really rendering it. `make android-screenshot` grabs the screen, `make android-inspect` forwards the WebView's devtools socket, and `make android-eval EXPR=...` evaluates in the real page. Four details are load-bearing. Only a `debuggable` build opens that socket, so the debug build type takes `applicationIdSuffix ".dev"` and installs *beside* the release app -- the two carry different signing certificates, and Android's only remedy for a changed certificate is an uninstall, which takes the user's library with it. Playwright cannot drive a WebView (`connectOverCDP` calls `Browser.setDownloadBehavior`, which it answers "Browser context management is not supported"), so the eval is raw CDP over Node's built-in WebSocket. The socket name carries the pid, so it is resolved per launch rather than written down. And `exec-out`, not `shell`, for the screenshot: a pty translates LF and corrupts the PNG. What it immediately established is why it was worth having. The phone renders in Chrome 113 at 424x439 CSS px -- two years behind every browser the other tiers use, with no Popover API and no relaxed CSS nesting -- so a spec passing at that viewport says nothing about the device, and two conclusions drawn from version numbers alone were wrong. Both are corrected in NOTES.md and the plan.
This commit is contained in:
@@ -83,6 +83,16 @@ android {
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
// Its own application id, so it installs *beside* the release
|
||||
// app rather than needing an uninstall to replace it. The two
|
||||
// are signed by different certificates (the release one comes
|
||||
// from a keystore CI holds), and Android's remedy for a
|
||||
// certificate change is an uninstall -- which takes the
|
||||
// user's library with it. This is also what makes the WebView
|
||||
// inspectable on a real phone: `debuggable` is what turns on
|
||||
// `setWebContentsDebuggingEnabled`, and `make android-inspect`
|
||||
// drives it.
|
||||
applicationIdSuffix ".dev"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user