Mobile website testing without a device lab

How to test a website on mobile without a device lab: what responsive mode proves, real-phone debugging on Android and iPhone, the checks, and the bug report.

Three upright glass slabs of shrinking width stand in a row, the narrowest one edged in orange

Mobile website testing without a device lab takes two tools: the desktop browser’s responsive mode for layout at every width, and one or two real phones connected to a computer for what emulation cannot copy, such as touch, the on-screen keyboard, the mobile engine and real speed. Then a short set of checks, and a report that names the device.

What responsive mode proves, and what it does not

Every desktop browser can draw a page at a phone’s size. Chrome and Edge call it device mode or device emulation, Firefox calls it Responsive Design Mode (Ctrl+Shift+M, or Cmd+Opt+M on a Mac), and Safari has its own Responsive Design Mode in the Develop menu. They set the viewport width and height and the device pixel ratio, and swap the orientation. Chrome and Firefox also turn mouse input into touch events and can slow the network.

The makers are clear about the limit. Chrome’s device mode documentation asks you to “think of device mode as a first-order approximation of how your page looks and feels on a mobile device”, says “there are some aspects of mobile devices that DevTools will never be able to simulate”, and gives the phone’s CPU as the example. Its advice: “When in doubt, your best bet is to actually run your page on a mobile device.” Apple’s page says its viewport presets “offer a good approximation” and do not represent the exact layout, rendering and behaviour of an actual device, and names three causes: the address bar, the on-screen keyboard and device-specific behaviour for form fields. Firefox asks you not to rely on its network throttling for exact performance measurements.

QuestionResponsive modeA real phone
Does the layout hold at each width and breakpoint?Settles itConfirms it
Is the viewport meta tag present and correct?Settles it, in the Elements panelShows the result
Does a control fit 24 by 24 CSS pixels?Measures itShows whether it can be hit
Does a hover menu open by touch?Imitates touch with a mouseSettles it
Does the keyboard cover the field or the Submit button?Has no on-screen keyboardSettles it
Does it behave the same in Safari on iOS?Runs the desktop engineSettles it
Is it fast enough?Throttles the network and CPU roughlySettles it, on a mid-range phone

So responsive mode is where layout bugs are found and measured, quickly, at any width. It never proves a page works on a phone. The web application testing guide sets this pass inside the wider responsive section, with the full matrix of widths.

How to test on a real phone without a device lab

A device lab is a shelf of phones. What most teams need is two: the Android phone and the iPhone somebody already owns, ideally one of them a few years old, and a cable. The cross-device testing entry explains how to choose more from analytics once the basics pass.

  • Android, from any computer. Turn on USB debugging in Developer options, connect the phone, open chrome://inspect#devices in desktop Chrome and click Inspect next to the page. Google’s remote debugging guide adds Toggle Screencast, which shows the phone’s screen inside DevTools and turns clicks into taps. To open a site that runs on your own machine, the local server guide forwards a port over the same cable, with localhost:8080 set up by default.
  • iPhone and iPad, with a Mac. Turn on Web Inspector in Settings, then Safari, then Advanced, and connect the device to the Mac by cable or after configuring wireless debugging in Xcode. WebKit’s guide says the device then appears in the Develop menu of Safari on the Mac. The Mac needs Safari’s developer features switched on, which our post on how to inspect element walks through.
  • iPhone, with no iPhone. The iOS Simulator that comes with Xcode runs Safari’s mobile engine on a Mac, and WebKit notes that remote inspection is always enabled for simulators. Apple’s responsive mode page suggests it for a more accurate preview. It still runs on a desktop processor, so speed is not a phone’s.
  • No Mac, and an iPhone bug. The phone can still open the page, and a screenshot and a screen recording from the phone show the fault. To read the console, a cloud device service that rents time on real phones is the usual answer.

Emulators for Android exist as well, and the mobile app testing entry covers what they and the iOS Simulator leave to physical devices. For a website, a real phone on a cable is quicker to set up than an emulator and settles more.

The checks that matter on a phone

Six checks cover the faults a phone shows most plainly, and each one has a standard or a vendor document behind it. The accessibility criteria below are the same ones the accessibility checklist cites, by number and level.

CheckWhat passesSource
Viewport meta tagwidth=device-width, MDN’s recommended value, with zoom left onMDN, viewport meta
ReflowNo sideways scrolling at 320 CSS pixels wide, except maps, data tables and the likeWCAG 2.2, 1.4.10 Reflow, Level AA
Target sizeControls at least 24 by 24 CSS pixels, or spaced as the exceptions allowWCAG 2.2, 2.5.8 Target Size (Minimum), Level AA
OrientationThe page works in portrait and in landscapeWCAG 2.2, 1.3.4 Orientation, Level AA
KeyboardsEach field brings up the right keyboard: type="email", type="tel", or inputmode="numeric" for digitsMDN, inputmode
HoverAnything that opens on hover also opens on tapChecked by hand

Four of these need a little more than the table says.

The viewport tag comes first. Without it, some mobile browsers lay the page out wider than the screen and shrink it to fit. MDN’s example is a 640px screen showing a page laid out in a virtual viewport of 980px, so a page that looks right in responsive mode arrives tiny on the phone. The same MDN page warns that user-scalable=no prevents people with low vision from reading the page, because they can no longer zoom. The viewport entry covers the tag and the vh and dvh units.

Reflow is a desktop check too. The W3C note on 1.4.10 says 320 CSS pixels equals a viewport of 1280 CSS pixels at 400 percent zoom, so one width covers a small phone and a desktop user who enlarges the page.

The keyboard changes the page. When the on-screen keyboard opens, the visual viewport shrinks and the layout viewport stays the same size, which is how a Send button fixed to the bottom of the screen ends up behind the keys. Only a real phone shows it. While the keyboard is up, check that the focused field stays in view and the form can still be submitted. MDN’s inputmode page also notes that inputmode only changes the keyboard and validates nothing, so the type still matters.

Rotation is a test of state. Turn the phone with a half-filled form on screen. The layout should change, and nothing typed should be lost.

A mobile pass, in order

The order below runs from the cheapest check to the one that needs hardware, so the layout bugs are found before anybody picks up a phone.

  1. In responsive mode, check the narrowest width the site supports, with 320 CSS pixels as the floor, then each breakpoint and one pixel either side of it. Look for sideways scrolling, cut-off text and overlapping controls.
  2. Measure the small controls: the close cross, the quantity buttons, the links in the footer. Anything under the target size is measured with its spacing before it is filed.
  3. Read the head of the page for the viewport tag, and confirm it does not switch zoom off.
  4. On the Android phone, connected to Chrome, go through the main journey: sign up, search, add to basket, pay, or whatever the site exists for. Keep DevTools open on the console.
  5. On the iPhone, the same journey in Safari, connected to Safari on a Mac where possible.
  6. On both, fill every form and watch the keyboard: the right layout of keys, the field still visible, the Submit button reachable.
  7. Rotate both phones in the middle of a form, and open every hover menu by tapping.
  8. On the older phone, with mobile data in place of wifi, load the heaviest page and judge whether it is usable.

A pass like this finds the faults a desktop review cannot. The browser differences behind some of them, and why the viewport often settles a report before the browser name does, are the subject of which browser is the wrong cross-browser question.

What a bug report from a phone needs

A bug seen on a phone is hard to reproduce on a laptop, so the report has to carry the conditions with it.

FieldWhere to find itWhy it matters
Device modelThe phone’s settings, under AboutScreen size, pixel ratio and speed differ by model
Operating system and versionThe same settings pageOn iOS, Safari’s engine is updated with the system
Browser and versionThe browser’s own About or Settings pageA bug can live in one browser on the same phone
Viewport in CSS pixelsThe developer tools over remote debugging, or a viewport-size page opened on the phoneDecides which breakpoint was showing
OrientationThe reporter’s own descriptionThe layout changes when the phone turns
Console errorThe console, over remote debugging, copied as textOften the cause, and never visible on the phone
ScreenshotThe phone’s screenshot, with the fault circledShows what the words cannot

A screenshot from a phone is in hardware pixels, so one from a phone with a pixel ratio of three is three times wider than the viewport it shows, which the device pixel ratio entry explains. Give the viewport as a separate figure and the screenshot will not contradict it. For the title, name the area, the failure and the condition, as in “Header: Menu button does nothing on iPhone Safari in portrait”, one of the examples in our post on bug report title examples.

Most people who find a bug on their phone will not plug it into a computer. A feedback widget closes part of that gap. The Notarus widget runs in mobile browsers, and a report filed through it carries the page URL, the browser, the operating system, the device, the screen and the viewport, with a screenshot the reporter marks up on their own screen. What a report can hold depends on capture settings and browser support, and the evidence capture page lists it.

Common questions

How do I test my website on mobile?

Start in the desktop browser's responsive mode to check the layout at phone widths, then open the page on at least one real Android phone and one real iPhone. Connect each to a computer to read the console, and check the viewport tag, reflow at 320 CSS pixels, tap target sizes, the on-screen keyboard and both orientations.

Is Chrome's device mode the same as testing on a phone?

Chrome's documentation calls device mode a first-order approximation of how a page looks and feels on a mobile device, and says some aspects of a phone, such as its CPU, can never be simulated there. Device mode runs the desktop engine at a phone's size. Touch, the mobile engine, the keyboard and real speed need a real phone.

Can I test a website on iPhone without a Mac?

Opening the page in Safari on an iPhone works from any computer, since the phone only needs the URL. Reading the iPhone's console is the part that needs a Mac: WebKit's Web Inspector connects to the phone from Safari on macOS, by cable or after wireless debugging is set up in Xcode. Without a Mac, a cloud device service is the usual route.

What is responsive design testing?

Responsive design testing checks that a layout adapts to each viewport width a site supports, with no lost content, no sideways scrolling and no control too small to tap. Most of it runs in a browser's responsive mode, one width at a time, and the breakpoints are checked one pixel either side of the switch.

How do I see a website's mobile version on a desktop computer?

Open the developer tools and switch on the device toolbar in Chrome or Edge, Responsive Design Mode in Firefox with Ctrl+Shift+M, or Enter Responsive Design Mode from Safari's Develop menu. Pick a phone preset or type a width. The page redraws at that size, and what you see is the desktop browser drawing a phone-sized page.

What should a mobile bug report include?

A mobile bug report needs the phone model, the operating system version, the browser and its version, the viewport in CSS pixels, the orientation, the steps and a screenshot with the fault marked. A console error copied over remote debugging, when there is one, saves the developer a round of questions.

The Notarus team

The people who build Notarus. We write up the decisions behind the product when the reasoning is worth more than the changelog line.

Keep reading

Reports with the evidence attached.

Start free, one script tag.

<script src="…/widget.js" data-key="pb_pub_…">