Give a browser agent a phone-sized viewport
Grip's viewport command resizes the emulated page viewport in Chromium down to 200 px wide, sets device scale factor (DPR), and optionally enables mobile layout and touch events without resizing your desktop window. Together with snap, it lets a terminal agent inspect narrow breakpoints, wrap behavior, and horizontal overflow fast.
This is emulation, not hardware testing. Grip's viewport command is Chromium-only and leaves the browser's user agent unchanged, so it cannot verify mobile Safari rendering, on-screen keyboard behavior, safe-area insets, or physical device latency. Use it only on sites you own or are authorized to test under their terms.
Grip browser actions require an active paid licence with no free tier, and commands stop when a licence ends or becomes invalid. Solo Dev ($79/year) covers one developer locally on up to 2 machines (excluding CI runners); Pro Runner ($499/year) covers headless, CI, multi-machine, and production workflows on up to 3 machines or CI runners; Platform (starts at $10k/year) covers redistribution, bundling, or external user access. Plans renew annually with a 2-day refund window, and Grip refreshes a signed lease with gripui.com every 5 hours; see the download instructions (gripui license activate <your-key>) and pricing page.
Apply a preset and capture CSS vs image pixels
On a macOS test host with Grip 6.5.1, these commands created a temporary headless profile, opened Example Domain, switched to the iphone-14 preset, and captured a screenshot:
gripui @grip-review02-20261204 set temporary
gripui @grip-review02-20261204 set headless
gripui @grip-review02-20261204 go https://example.com
gripui @grip-review02-20261204 hud
gripui @grip-review02-20261204 viewport iphone-14
gripui @grip-review02-20261204 snap /tmp/grip-review02-phone.png
On that single public run, go finished synchronously in 1.34 seconds wall time and hud took 0.25 seconds (Example Domain, [1] click link:"Learn more"). Commands still running after 2 seconds return a background handle instead, inspected via gripui handle (or run synchronously with GRIPUI_SYNC=1). A hud call can exit nonzero when page actions change while still printing the updated sheet, so read its output rather than relying on the exit code alone.
The viewport iphone-14 receipt returned ok: viewport set to 390x844 dpr=3 mobile=true; observed {"dpr":3,"height":844,"touch":true,"width":390}. The following snap receipt reported 262938bytes, image=1170x2532px, viewport=390x844css, and scale=3.00, which file confirmed independently as 1170 x 2532 PNG image data. Because DPR is 3, each CSS pixel maps to 3 output pixels on each axis (390 * 3 = 1170, 844 * 3 = 2532); the byte count depends on page content and PNG compression.
Grip also documents iphone-se and pixel-7 presets, though only iphone-14 was tested in this run. Inspect the observed JSON dimensions in your receipt rather than assuming preset sizes or mistaking physical image pixels for CSS breakpoint pixels. Before clicking after a viewport resize, refresh gripui hud so refs and hittability match the reflowed layout.
Set an explicit width, DPR, and layout mode
For exact CSS breakpoint checks, pass WxH explicitly instead of a phone preset. This tested command requests a 390-by-844 CSS viewport at DPR 2 with mobile layout and touch enabled:
gripui @grip-review02-20261204 viewport 390x844 --dpr 2 --mobile
The receipt reported ok: viewport set to 390x844 dpr=2 mobile=true; observed {"dpr":2,"height":844,"touch":true,"width":390}. CSS width controls media queries and wrapping, while --dpr controls the output pixel multiplier and image file size. A separate screenshot was not taken at DPR 2; verify each explicit setting from its own snap receipt.
A plain WxH argument creates a desktop-type viewport without touch unless you pass --mobile. Conversely, --desktop applies desktop layout without touch to a device preset. Because viewport changes do not rewrite the user agent, reload the page after setting the viewport if your app chooses markup at request time, and expect server-side user-agent branching to stay unchanged.
Keep CSS coordinates and image pixels separate if you ever pass --coords to gripui click. As the snap receipt notes, divide image pixel coordinates by the reported scale (3.00 for iphone-14) to get CSS coordinates. Prefer current gripui hud refs whenever possible, because refs follow semantic targets instead of fragile pixel offsets.
Reset emulation and clean up
gripui @grip-review02-20261204 viewport off
gripui quit --profile grip-review02-20261204
Running viewport off restored {"dpr":2,"height":857,"touch":false,"width":1280} on the test host, which reflects that machine's default window rather than a universal value. The emulation otherwise persists until cleared or the browser restarts. Calling gripui quit --profile grip-review02-20261204 stopped the browser and deleted the temporary profile; use a dedicated persistent profile only when your test explicitly requires retained sign-in state.
Choose between Grip and Playwright for mobile checks
Use Grip's viewport command for fast interactive checks from the terminal: verify whether a navigation bar wraps, a primary button stays reachable, or an expanded drawer triggers horizontal overflow at 390 px. Always record the exact width, height, DPR, browser, and interactive state alongside any saved screenshot so another engineer can reproduce it. Check open menus, error banners, and modals as well as the initial screen, because overlays often overflow after interaction.
When you want automated multi-engine responsive regression tests in CI, Playwright is the better choice: playwright.devices ships descriptors (such as devices['iPhone 13']) that configure viewport, userAgent, deviceScaleFactor, and hasTouch together, and expect(page).toHaveScreenshot() validates layouts across Chromium, Firefox, and WebKit. Neither Chromium tool replaces testing on real phones when mobile Safari, touch gestures, native keyboards, camera permissions, or device performance matter.
Next: to drive a remote BrowserBox you own, use gripui connect browserbox '<login-link>' --engine with its login link; that remote connection was not tested here. Evaluate BrowserBox and see Grip pricing.