Mobile: Appium, Espresso, XCUITest, Maestro
A different set of problems: device farms, permissions, gestures, build pipelines that take twenty minutes. Learn one native framework properly before reaching for a cross-platform one.
Mobile test automation drives a real or simulated phone rather than a browser.
Four tools dominate. Appium is cross-platform and driver-based, using the same WebDriver protocol Selenium uses. Espresso is Google's in-process framework for Android. XCUITest is Apple's equivalent for iOS. Maestro is a newer declarative tool with a much simpler configuration.
The framework choice is the easy part. The hard parts are the same for all four. Getting a build to test, finding devices to run on, and a phone having state and interruptions a browser never has.
The terms you will hear
- Emulator and simulator. A virtual Android device, and a virtual iPhone. Fast, and not identical to hardware.
- Real device. Actual hardware, locally or in a cloud farm.
- Device farm. A hosted pool of devices you run against, such as BrowserStack or Sauce Labs.
- Instrumentation. Espresso and XCUITest running inside the app process, which is why they are fast and reliable.
- Appium driver. The component translating commands into platform automation.
- Flow. Maestro's term for a test, written in YAML.
Choosing between them
- Appium when one suite must cover both platforms and the team writes in a shared language. The cost is speed and a heavier setup.
- Espresso and XCUITest when the app teams own their tests. Faster, more stable, and you maintain two suites.
- Maestro when you want a small readable suite quickly, especially for smoke checks. Less powerful for complex flows.
There is no wrong answer here, and the honest tiebreaker is who will maintain it. A suite the app developers will run beats a cross-platform suite only you understand.
The mobile-only failure modes
These are the cases a web suite never has to think about, and they are where real defects live.
- Permissions. Denied, then granted later. Revoked while the app runs. The dialog appearing on first launch only.
- Interruptions. An incoming call, a notification, the app backgrounded and restored an hour later.
- Network transitions. Wifi to mobile data, an airplane-mode toggle, a captive portal, genuinely slow 3G.
- State and storage. Upgrading over an old version with existing data. A full disk. Cleared cache.
- Device variety. A small screen, a large font accessibility setting, dark mode, an old OS version.
- Background limits. Android killing your process, iOS suspending a background task mid-upload.
How to make it survivable
- Choose the device matrix from analytics. The four or five combinations your users actually have, not a spread for coverage's sake.
- Run smoke on emulators, release checks on real devices. Emulators are fast and lie about performance and hardware.
- Reset state per test. Reinstall or clear data, so tests are hermetic in the same sense as determinism requires everywhere else.
- Handle permissions explicitly, granting them in setup so the dialog is never a surprise, plus one deliberate denied-permission test.
- Automate the smoke path only, at first. Launch, log in, the one core journey. This catches most build-level breakage for little maintenance.
- Keep the interruption cases manual until they are stable. They are valuable and the hardest to automate reliably.
- Expect a higher flake rate than web and hold the same quarantine discipline anyway.
A worked matrix
For example, here is one team's mobile setup and what it caught.
FROM ANALYTICS top device and OS combinations, 6 months of sessions
iPhone 13 / iOS 17 31 percent
iPhone 15 / iOS 18 18
Pixel 7 / Android 14 12
Samsung A54 / Android 13 11
iPhone SE 2020 / iOS 17 6 <-- smallest screen we support
everything else 22
MATRIX 5 combinations, not 20. the long tail gets manual attention
when a defect suggests it.
WHERE TESTS RUN
every pull request Android emulator + iOS simulator, smoke only
(launch, log in, buy a book, apply a gift card)
about 6 minutes
nightly the 5 real devices in a cloud farm, 22 flows
before release manual pass on the 5, including interruptions
WHAT THE MANUAL INTERRUPTION PASS FOUND, LAST THREE RELEASES
- backgrounding during payment lost the basket on iOS critical
- denying camera permission for the gift card scanner crashed
the app rather than falling back to manual entry high
- upgrading from 4.2 with a saved basket showed an empty
basket and kept the old data high
- a large accessibility font pushed the Apply button off
screen on iPhone SE high
none of these were catchable by the automated suite as it stands.
FLAKE RATE
emulator smoke 2 percent
real device 7 percent, mostly farm session start-up
policy: the same quarantine rule as web, plus farm failures are
labelled separately so they do not look like product defects.The four manual findings are the point. Every one is a mobile-only failure mode, and none of them would appear in a framework comparison or in an automated suite aimed at the happy path.
How to show you know it
- A matrix from analytics. Five combinations with percentages beats twenty chosen for symmetry.
- An interruption finding. Backgrounding during payment is the classic, and it lands with everyone.
- A separated flake category. Distinguishing farm failures from product defects keeps the numbers honest.
- A staged plan. Emulator smoke per pull request, real devices nightly, manual interruptions per release.
Questions
Appium or the native frameworks?
If the app developers will own the tests, native wins on speed and stability. If one team must cover both platforms in one language, Appium earns its overhead. Maintenance ownership is the real tiebreaker.
Are emulators good enough?
For smoke checks and most functional flows, yes. Not for performance, camera, biometrics, push notifications or anything hardware-dependent, and not for the final release check.
How many real devices do we need?
The ones covering the bulk of your sessions, usually four or five. Buying breadth for its own sake costs runtime and rarely finds anything your top devices did not.
Should visual regression run on mobile?
On a couple of key screens at the smallest supported size, yes, since layout breaks there first. Keep it narrow, per visual regression.