---
title: 'Mobile Browsers: Safari on iOS, Chrome on Android'
description: On many sites, more than half of all visits come from phones, and chapter
  2&#39;s example put Safari on iPhone second only to Chrome on Windows. Yet mobile…
source_url:
  html: https://testingbot.com/resources/courses/cross-browser-testing/mobile-browsers
  md: https://testingbot.com/resources/courses/cross-browser-testing/mobile-browsers.md
---

Course

[Cross-Browser Testing Tutorial](https://testingbot.com/resources/courses/cross-browser-testing)

Chapter 7 of 11

1. [1 Cross-Browser Testing Tutorial](https://testingbot.com/resources/courses/cross-browser-testing)
2. [2 Chromium, Gecko and WebKit: What Really Differs](https://testingbot.com/resources/courses/cross-browser-testing/browser-engines)
3. [3 Choosing a Browser Matrix from Real Analytics](https://testingbot.com/resources/courses/cross-browser-testing/choosing-a-browser-matrix)
4. [4 Writing Tests That Survive Engine Differences](https://testingbot.com/resources/courses/cross-browser-testing/tests-that-survive-engine-differences)
5. [5 Selenium Across Browsers and Versions](https://testingbot.com/resources/courses/cross-browser-testing/selenium-across-browsers)
6. [6 Playwright Projects and Branded Browsers](https://testingbot.com/resources/courses/cross-browser-testing/playwright-across-browsers)
7. [7 Mobile Browsers: Safari on iOS, Chrome on Android](https://testingbot.com/resources/courses/cross-browser-testing/mobile-browsers)
8. [8 Run the Matrix in Parallel on TestingBot](https://testingbot.com/resources/courses/cross-browser-testing/run-the-matrix-in-parallel)
9. [9 Debugging a Browser-Specific Failure](https://testingbot.com/resources/courses/cross-browser-testing/debug-a-browser-specific-failure)
10. [10 Visual Differences Between Browsers](https://testingbot.com/resources/courses/cross-browser-testing/visual-differences)
11. [11 Knowledge Check](https://testingbot.com/resources/courses/cross-browser-testing/knowledge-check)

[Exit course](https://testingbot.com/resources/courses)

 Chapter 7 of 11 Intermediate 9 min read 2 quick checks Updated Nov 2026 

# Mobile Browsers: Safari on iOS, Chrome on Android
On this page
1. [What is different on a phone](https://testingbot.com#what-is-different-on-a-phone)
2. [Emulation, simulators and real devices](https://testingbot.com#emulation-simulators-and-real-devices)
3. [Selenium on a real iPhone and a real Android phone](https://testingbot.com#selenium-on-a-real-iphone-and-a-real-android-phone)
4. [Ask for a kind of device, not one device](https://testingbot.com#ask-for-a-kind-of-device-not-one-device)
5. [And Playwright?](https://testingbot.com#and-playwright)
6. [Exploratory testing on real phones](https://testingbot.com#exploratory-testing-on-real-phones)
7. [Summary](https://testingbot.com#summary)

On many sites, more than half of all visits come from phones, and chapter 2's example put Safari on iPhone second only to Chrome on Windows. Yet mobile browsers are the part of the matrix most often covered by emulation alone. This chapter explains what emulation misses, and runs the login test on a real iPhone and a real Android phone.

## What is different on a phone[#](https://testingbot.com#what-is-different-on-a-phone)

A mobile browser is not a desktop browser in a small window. The engine may be the same, but the shell, the input and the screen are not:

- **The viewport changes size.** Mobile Safari and Chrome on Android show and hide their toolbars as you scroll, so the visible height changes. Layouts built on `100vh` can put a button under the toolbar. The `svh`, `lvh` and `dvh` units exist because of this.
- **The keyboard covers the page.** An on-screen keyboard can hide the field being typed in or the submit button below it. You will see this break a real test later in this chapter.
- **There is no hover.** Menus that open on `:hover` need a tap alternative; a test that hovers on desktop has no equivalent on a touchscreen.
- **Input is touch.** Tap targets can be too small or too close together, and gestures such as swipe and pinch have no desktop equivalent.
- **Native controls are different again.** Date pickers, select boxes and file inputs open full-screen OS sheets instead of desktop dropdowns.
- **Safari on iOS zooms into form fields** whose font size is below 16 pixels, which shifts the layout while the user types.

On iOS there is one more rule worth repeating from chapter 1: for most of the platform's history every browser had to use WebKit, so Chrome on an iPhone has been Safari's engine with Google's shell. Since iOS 17.4, browsers distributed in the EU may use other engines. When you read "Chrome, iOS" in your analytics, treat it as WebKit unless you know otherwise.

## Emulation, simulators and real devices[#](https://testingbot.com#emulation-simulators-and-real-devices)

There are three levels of fidelity, with different costs:

| | What it is | Good for | Misses |
| --- | --- | --- | --- |
| Device emulation | A desktop engine with a phone-sized viewport, touch events and a mobile user agent (Playwright's `iPhone 15` preset, Chrome DevTools device mode) | Responsive layout, breakpoints, fast feedback on every commit | Toolbars, keyboard, real touch handling, the real browser shell, performance |
| Simulators and emulators | Apple's iOS Simulator or the Android Emulator running the real mobile OS and browser on a computer | Most functional behaviour of the real browser | Real hardware performance, sensors, some GPU and media behaviour |
| Real devices | Physical phones and tablets | Release confidence; exactly what users run | Nothing, but they are the slowest and scarcest resource |

A pragmatic split: emulation in the smoke tier, real devices for the one or two mobile rows at the top of your analytics in the full tier.

Users report that the "Pay" button on your checkout is hidden behind the browser toolbar on iPhones. Your Playwright `iPhone 15` project is green. Why did it not catch this?

 The preset uses an older iOS version Emulation reproduces the viewport size, not Safari's toolbars that resize the visible area The test needs `hasTouch: true`

A device preset is a fixed-size window on a desktop engine. Mobile Safari's collapsing toolbars and the on-screen keyboard only exist in the real browser, on a simulator or a real device.

## Selenium on a real iPhone and a real Android phone[#](https://testingbot.com#selenium-on-a-real-iphone-and-a-real-android-phone)

Mobile browser sessions use the same WebDriver protocol as desktop ones. TestingBot routes them through Appium on its side, so your test still uses the plain Selenium client; only the capabilities change:

- `platformName` is `iOS` or `Android`.
- `appium:deviceName` names the device. It accepts a regular expression, which matters more than it seems (see below).
- `browserVersion`, if you set it, is the **OS version** on mobile, not the browser version.
- `realDevice: true` in `tb:options` asks for a physical device instead of a simulator or emulator.

Use `SafariOptions` for iOS and `ChromeOptions` for Android, so `browserName` is right. This script runs the login test from chapter 4 on either:

```python
import os
import sys

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

DEVICES = {
    "iphone": (webdriver.SafariOptions, {
        "platformName": "iOS",
        "appium:deviceName": "iPhone 1[5-7].*",
    }),
    "pixel": (webdriver.ChromeOptions, {
        "platformName": "Android",
        "appium:deviceName": "Pixel 1[01].*",
    }),
}

options_class, caps = DEVICES[sys.argv[1]]
options = options_class()
for name, value in caps.items():
    options.set_capability(name, value)
options.set_capability("tb:options", {
    "key": os.environ["TB_KEY"],
    "secret": os.environ["TB_SECRET"],
    "realDevice": True,
    "name": f"mobile login {sys.argv[1]}",
    "build": os.environ.get("TB_BUILD", "local"),
})

driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)
print("session", driver.session_id)
try:
    driver.get("https://the-internet.herokuapp.com/login")
    print("viewport", driver.execute_script("return [innerWidth, innerHeight, devicePixelRatio]"))
    print("ua", driver.execute_script("return navigator.userAgent"))
    driver.find_element(By.ID, "username").send_keys("tomsmith")
    driver.find_element(By.ID, "password").send_keys("SuperSecretPassword!")
    # Close the on-screen keyboard first: on a phone it can cover the button.
    driver.execute_script("document.activeElement.blur()")
    driver.find_element(By.CSS_SELECTOR, "button[type='submit']").click()
    flash = WebDriverWait(driver, 15).until(
        EC.visibility_of_element_located((By.ID, "flash")))
    assert "You logged into a secure area!" in flash.text
    driver.execute_script("tb:test-result=passed")
except Exception:
    driver.execute_script("tb:test-result=failed")
    raise
finally:
    driver.quit()
```

Here is the output from a passing run on each platform:

```
$ python mobile_check.py iphone
session 9b51dc90da5b-779d33ad6854-af553fa78580-179449862194-37903431
viewport [440, 796, 3]
ua Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.6.1 Mobile/15E148 Safari/604.1

$ python mobile_check.py pixel
session 8b102158dacd-93382bf0ec34-83486733e5d4-179449859648-71760374
viewport [411, 753, 2.625]
ua Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Mobile Safari/537.36
```

The iPhone was an iPhone 17 Pro Max and the Android phone a Pixel 11 on Android 17. Neither is visible in the user agent: iOS reports `iPhone OS 18_7` and Android reports `Android 10; K`, both frozen values, just like the desktop browsers in chapter 1. The viewport numbers are CSS pixels, which is what your media queries see; the device pixel ratio of 3 or 2.625 is why screenshots from the device are so much larger.

Two lines in the script are there because earlier versions failed, and both failures are typical of mobile.

**The explicit wait.** The first version looked up the result message straight after the click, as some desktop tests get away with. On the iPhone it failed with `NoSuchElementException`. Mobile page loads are slower, and a test that is only correct when the page is fast is not correct.

**The `blur()` before the click.** Without it, the test failed on the Pixel 11 twice in a row with a `TimeoutException` while it passed on the iPhone and on an older Pixel. The video showed the filled-in form and no navigation. Measuring in the browser explained it: with the password field focused, the on-screen keyboard was open and `visualViewport.height` was 398 pixels out of a 753-pixel layout viewport, while the Login button sat between 443 and 502 pixels from the top. The button was under the keyboard, and the click never reached the page (a click listener on the button counted zero clicks). Pressing Enter in the password field submitted the form, and so did closing the keyboard before clicking. A real user would do one of those two things too; a desktop test never has to.

## Ask for a kind of device, not one device[#](https://testingbot.com#ask-for-a-kind-of-device-not-one-device)

Our first attempts named one exact model and OS version. A later run failed before it started:

```
TestingBot was unable to fulfill your request, most likely the device is currently in use.
```

A specific physical device can only run one session at a time. Unless the bug you are chasing is specific to one model, ask for a pattern: `iPhone 1[5-7].*` takes any free iPhone 15, 16 or 17, and `Pixel 1[01].*` any Pixel 10 or 11. The [mobile options documentation](https://testingbot.com/support/web-automate/mobile) explains the device and version capabilities, and the [device list](https://testingbot.com/support/web-automate/browsers) shows what is available.

Nightly runs on real devices often fail before the first command with "device is currently in use". What helps most?

 Switching to the Playwright `iPhone 15` preset Adding `time.sleep(60)` before creating the driver A regular expression in `appium:deviceName`, such as `iPhone 1[5-7].*`, so any matching free device can take the session

One physical device runs one session at a time. A pattern lets the grid pick whichever matching device is free. Emulation would avoid the error by not testing a real device at all.

## And Playwright?[#](https://testingbot.com#and-playwright)

Playwright cannot drive Safari on iOS: its WebKit runs on desktop operating systems only, and iPhone presets are emulation. For Android, Playwright has experimental support for Chrome on Android devices and emulators through its `_android` API, and TestingBot supports it; the [Playwright mobile guide](https://testingbot.com/support/web-automate/playwright/mobile) has the setup. For a suite that must cover real iPhones, Selenium (or Appium directly) is the tool, which is why many teams keep a small Selenium mobile suite next to a Playwright desktop suite.

## Exploratory testing on real phones[#](https://testingbot.com#exploratory-testing-on-real-phones)

Some mobile problems are easier to find by hand than by script: a keyboard that covers the field, a tap target that is too small, a scroll that feels wrong. A [live session on a real device](https://testingbot.com/support/web-live) gives you the phone in your browser, with the device's own Safari or Chrome. It is the right tool for the exploratory tier from chapter 2.

## Summary[#](https://testingbot.com#summary)

- Mobile browsers differ from desktop in viewport, keyboard, input and native controls, not only in screen size.
- Emulation is for fast layout checks; real devices are for release confidence on your top mobile rows.
- Selenium drives real iPhone Safari and Android Chrome with `platformName`, `appium:deviceName` and `realDevice`; on mobile, `browserVersion` is the OS version.
- Ask for a device pattern rather than one device, and always wait for state: mobile is slower.
- The on-screen keyboard is part of the page on a phone: close it, or submit the way a user would, before clicking what it may cover.

[Previous · Chapter 6 Playwright Projects and Branded Browsers](https://testingbot.com/resources/courses/cross-browser-testing/playwright-across-browsers) [Next · Chapter 8 Run the Matrix in Parallel on TestingBot](https://testingbot.com/resources/courses/cross-browser-testing/run-the-matrix-in-parallel)

On this page

1. [What is different on a phone](https://testingbot.com#what-is-different-on-a-phone)
2. [Emulation, simulators and real devices](https://testingbot.com#emulation-simulators-and-real-devices)
3. [Selenium on a real iPhone and a real Android phone](https://testingbot.com#selenium-on-a-real-iphone-and-a-real-android-phone)
4. [Ask for a kind of device, not one device](https://testingbot.com#ask-for-a-kind-of-device-not-one-device)
5. [And Playwright?](https://testingbot.com#and-playwright)
6. [Exploratory testing on real phones](https://testingbot.com#exploratory-testing-on-real-phones)
7. [Summary](https://testingbot.com#summary)

Certification

Earn the free, resume-worthy TestingBot Cross-Browser Testing Certification for this course.

[How it works](https://testingbot.com/resources/courses/cross-browser-testing/certification)
