ZeuZ

Getting Started with Mobile Automation on Real Devices

Key Takeaways

  • Emulators and simulators are best for fast, cheap checks; real devices are needed for release confidence.
  • Choose devices from your analytics: the models and OS versions most of your users have, plus the oldest version you support.
  • An in-house lab gives full control; a device cloud gives wide coverage without buying hardware. Many teams use both.
  • Android devices connect over USB debugging; iOS devices need macOS, Xcode, and signing set up first.
  • Keep real-device runs stable with clean device states, smart waits, stable element IDs, and retries only for known infrastructure failures.
Blog

Share with your community!

How Do You Get Started with Mobile Automation on Real Devices?

To get started with mobile automation on real devices, run your fast checks on emulators first, then pick a small set of real phones that match your users. Decide whether to own them in a device lab or rent them from a device cloud, connect them to your test framework, and run a short release suite on them from CI/CD. Real devices catch what emulators miss: true performance, hardware, sensors, network behavior, and manufacturer quirks.

When do you need real devices instead of emulators?

Emulators and simulators run on your computer or build server, so they're fast to start and easy to run in parallel. They copy a device's software, not its hardware, which is why some bugs only appear on a physical phone.

What you're testingEmulators and simulatorsReal devices
UI logic and layoutsGoodGood
Cost and setupFree and quickHardware or subscription, more setup
Running many tests in parallelEasyLimited by the number of devices
CPU, memory, and performanceApproximateAccurate
Camera, GPS, biometrics, and sensorsSimulated or missingReal behavior
Real mobile networks and switchingSimulatedReal behavior
Battery and heat under loadNot availableReal behavior
Manufacturer skins and OS changesNot coveredCovered
Push notifications and interruptionsPartlyReal behavior

A common split: emulators on every commit and pull request, and real devices for nightly runs, release candidates, and bugs users report on specific models. For framework choices on each platform, see our guide to Android and iOS test automation.

How do you choose which real devices to test on?

  1. Start with your analytics. List the device models and OS versions your users actually have, by share of sessions.
  2. Cover the top of the list. A handful of devices usually covers most users; add more only when the data shows a gap.
  3. Add the edges. Include the oldest OS version you support, a small-screen phone, a large phone or tablet, and a low-memory device.
  4. Mix manufacturers on Android. Different brands customize Android, so one phone each from your top brands catches vendor-specific bugs.
  5. Review the list regularly. Update it after major OS releases and as your user base shifts.

Should you build a device lab or use a device cloud?

FactorIn-house device labDevice cloud
Upfront costBuy phones, hubs, and racksNone; monthly or annual subscription
Ongoing workCharging, updates, cables, and replacementsHandled by the provider
Device rangeOnly what you buyThousands of models on demand
Data and network controlStays inside your networkRuns on the provider's infrastructure
AvailabilityAlways yoursShared; may queue at busy times
Best forA small core set used every day; strict data rulesWide coverage and rare models

Many teams keep a small in-house lab for daily runs and rent a device cloud for wider release checks. If you're comparing providers, our guide to LambdaTest alternatives covers the main device clouds and how they price devices.

How do you connect real devices to your test automation?

Android devices

  1. Turn on Developer options (tap the build number in Settings several times), then enable USB debugging.
  2. Install the Android SDK platform tools on the test machine and connect the phone by USB.
  3. Run adb devices and accept the debugging prompt on the phone; the device should show as connected.
  4. Point your framework (Espresso, Appium, or Maestro) at the device's ID and run a simple test, such as launching the app and checking the home screen.

iOS devices

  1. Use a Mac with Xcode installed, connect the iPhone, and choose Trust This Computer on the phone.
  2. Turn on Developer Mode on the iPhone (Settings, Privacy & Security) on recent iOS versions.
  3. Set up an Apple developer account, signing certificate, and provisioning profile that includes the device.
  4. Run XCUITest from Xcode or the command line, or configure Appium's XCUITest driver, which installs a helper app on the device to drive the UI.

Your first real-device run

Start with one short, stable test, such as opening the app, logging in, and checking one screen. Once it passes reliably on every device in your list, add your core journeys one at a time.

How do you scale real-device testing in CI/CD?

  • Run a smaller suite on real devices. Keep the full regression suite on emulators and a focused release suite on physical phones.
  • Run devices in parallel. Split tests across devices so total time stays short.
  • Use dedicated test machines. Connect lab devices to build agents through powered USB hubs, and use Mac agents for iOS.
  • Trigger from the pipeline. Run device tests nightly and on release branches, with results posted back to the team. Our guide to CI/CD test automation covers how to stage these runs.
  • Reset devices between runs. Uninstall or clear the app and its data so every test starts from the same state.

How do you keep real-device tests from becoming flaky?

  • Wait for conditions, not fixed times. Wait until an element is visible or a request finishes instead of adding sleeps.
  • Use stable element IDs. Accessibility identifiers on iOS and resource IDs on Android survive layout changes far better than text or screen positions.
  • Build reusable steps. Steps like "log in" or "add to cart" are fixed once when the UI changes, not in every test.
  • Control test data. Use dedicated test accounts and reset data so tests don't depend on each other.
  • Watch the hardware. Low battery, full storage, OS update prompts, and loose cables cause failures that look like bugs.
  • Separate infrastructure failures from real ones. Retry automatically only when a device disconnects or times out, and track flaky tests so they get fixed, not ignored.
  • Capture evidence. Save screenshots, videos, and logs on every failure so the cause is clear without re-running.

How does AI help with mobile test automation?

AI is changing how tests are written and maintained more than where they run. Common uses include:

  • Writing tests from plain language. Describe a journey and get structured test steps to review.
  • Diagnosing failures. AI can compare a failed run with past runs and point to the likely cause, such as a changed element or a slow response.
  • Proposing repairs. When a screen changes, AI can suggest updated locators or steps for a person to approve.
  • Choosing what to run. Change-based test selection runs the tests most likely to be affected by a code change.

ZeuZ Test Studio applies these ideas to web, API, and database testing. Teams describe tests in plain language, review the generated code, and get reports with step-level results, screenshots, and traces. It automates mobile web at phone and tablet sizes in Chrome, Firefox, Edge, and Safari, and checks the APIs and data behind your app. For native app screens on physical phones, teams pair it with a mobile framework such as Espresso, XCUITest, or Appium.

Final thoughts

Real devices are where mobile testing meets reality. Start small: a few phones chosen from your analytics, one stable test, and a release suite that grows one journey at a time. Use emulators for speed, real devices for confidence, and a device cloud when you need models you don't own.

Want to see how web, API, and data checks would fit alongside your device testing? Talk to the team.

How do you connect an Android phone for automated testing?

Turn on Developer options and USB debugging on the phone, install the Android platform tools on your test machine, connect by USB, and run adb devices to confirm the connection. Your test framework then targets the phone by its device ID. Talk to the team →

Why does iPhone testing need Developer Mode?

Recent iOS versions block apps installed for development, and test helpers, from running until Developer Mode is turned on. You also need a Mac with Xcode and a provisioning profile that includes the device. Talk to the team →

Is a device cloud safe for testing apps with sensitive data?

It can be, if you use test accounts and synthetic data and check the provider's security controls. Teams whose data must stay inside their own network usually keep testing in an in-house device lab instead. Talk to the team →

Can you run automated tests on real devices in a CI/CD pipeline?

Yes. Connect lab devices to build agents, or call a device cloud from the pipeline, and run a focused real-device suite nightly or on release branches. Keep faster emulator tests on every commit. Talk to the team →

Why do tests pass on emulators but fail on real devices?

Real devices add slower hardware, real networks, manufacturer changes to the OS, permission prompts, and battery or storage limits. Timing-based waits and screen-position selectors often break under these conditions, so use condition-based waits and stable element IDs. Talk to the team →

Related Blogs