Getting Started with Mobile Automation on Real Devices
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 testing | Emulators and simulators | Real devices |
|---|
| UI logic and layouts | Good | Good |
| Cost and setup | Free and quick | Hardware or subscription, more setup |
| Running many tests in parallel | Easy | Limited by the number of devices |
| CPU, memory, and performance | Approximate | Accurate |
| Camera, GPS, biometrics, and sensors | Simulated or missing | Real behavior |
| Real mobile networks and switching | Simulated | Real behavior |
| Battery and heat under load | Not available | Real behavior |
| Manufacturer skins and OS changes | Not covered | Covered |
| Push notifications and interruptions | Partly | Real 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?
- Start with your analytics. List the device models and OS versions your users actually have, by share of sessions.
- Cover the top of the list. A handful of devices usually covers most users; add more only when the data shows a gap.
- Add the edges. Include the oldest OS version you support, a small-screen phone, a large phone or tablet, and a low-memory device.
- Mix manufacturers on Android. Different brands customize Android, so one phone each from your top brands catches vendor-specific bugs.
- 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?
| Factor | In-house device lab | Device cloud |
|---|
| Upfront cost | Buy phones, hubs, and racks | None; monthly or annual subscription |
| Ongoing work | Charging, updates, cables, and replacements | Handled by the provider |
| Device range | Only what you buy | Thousands of models on demand |
| Data and network control | Stays inside your network | Runs on the provider's infrastructure |
| Availability | Always yours | Shared; may queue at busy times |
| Best for | A small core set used every day; strict data rules | Wide 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
- Turn on Developer options (tap the build number in Settings several times), then enable USB debugging.
- Install the Android SDK platform tools on the test machine and connect the phone by USB.
- Run adb devices and accept the debugging prompt on the phone; the device should show as connected.
- 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
- Use a Mac with Xcode installed, connect the iPhone, and choose Trust This Computer on the phone.
- Turn on Developer Mode on the iPhone (Settings, Privacy & Security) on recent iOS versions.
- Set up an Apple developer account, signing certificate, and provisioning profile that includes the device.
- 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 →