Kickstarting Mobile Automation with Appium
Master Appium automation for Android and iOS by building cross-platform mobile tests from setup to execution, and easily scale your app testing.
Author

Date

Book a call
Table of Contents
From Setup to Your First Test on Emulator and Real Device
- What Appium is and how it works
- Setting up your automation environment
- Running your first test on the emulator and real devices
- Common issues and how to fix them
What is Appium?
Appium is an open-source automation tool that allows you to test native, hybrid, and mobile web apps on both Android and iOS platforms — using the same API. Built on the WebDriver protocol (just like Selenium), Appium provides the flexibility to write tests in your favorite programming language.
Why Appium?
- No need to recompile or modify the app under test
- Supports Java, Python, JavaScript, Ruby, and more
- Works across Android and iOS platforms
- Completely free and actively maintained
Understanding Appium Architecture
Appium operates on a client-server model built over the WebDriver protocol. It acts as a bridge between your automation scripts and the mobile device — whether it’s an emulator, simulator, or a real phone. This architecture allows platform-independent test execution using a single API.
1. Appium Client
2. Appium Server
3. Automation Engines
- UIAutomator2 / Espresso (Android) – Executes commands on Android devices
- XCUITest (iOS) – Executes commands on an iOS device
4. Mobile Device (Emulator, Simulator, or Real Device)
5. Platform-Specific Bootstrap Components
How Appium Executes a Test Command
Here’s the complete flow of a single test command inside Appium’s architecture:
- Command Sent: Your test script (client) sends a command using WebDriver over HTTP (e.g., “Tap the Login button”).
- Server Processes: The Appium Server receives and parses the command, checks the desired capabilities to identify the platform.
- Routing to Engine: Based on the platform (Android/iOS), the server forwards the command to the correct automation engine.
- Interaction with Device: The engine acts as the app via the connected device or emulator.
- Response Returned: The result (success/failure) travels back through the engine and server to the test script.
Prerequisites Before You Begin
To get started with Appium, ensure the following software and tools are ready:
Required Tools:
- Java JDK (11 or higher)
- Node.js & npm
- Android Studio (for SDKs, emulator, platform tools)
- Appium CLI
- Appium Inspector
- Code Editor or IDE (e.g., IntelliJ, VS Code)
Programming Language Setup
Setting Up Your Automation Environment
Here’s a step-by-step installation guide:
1. Install Node.js & NPM
2. Install Appium CLI Globally
To start the server:
3. Verify Setup with Appium Doctor
It will check for missing dependencies, such as Java and Android tools.
4. Install Appium Inspector

5. Set Environment Variables
Then:
Android Studio & Emulator Setup
1. Install Android Studio
- Download from: https://developer.android.com/studio
2. Set Up SDK Tools
- Open Android Studio → SDK Manager
- Install: SDK Tools, Platform Tools, and Build Tools
3. Create and Launch an Emulator

2. Under Device Manager, click on the plus icon to create a new virtual machine.

3. Select the device configuration from the list of virtual devices and click on “Next”.

4. Complete the configuration process by selecting the operating Android version.

5. Update the name of the virtual device and click on “Finish”.

6. And you are almost done:


Getting Started with ADB (Android Debug Bridge)
ADB is a powerful command-line tool that lets you communicate with Android devices.
Common ADB Commands:
Make sure your device or emulator is listed:
Command to find App Package and App Activity:
Make sure the app is in a running state in the emulator/physical device.
Writing Your First Appium Test on Emulator
1. Define Desired Capabilities (JAVA):
Desired Capabilities for Appium Inspector to Inspect Mobile Elements:

2. Sample Test Code: Launching Emulator Chrome Browser
Run the script using Maven(Archetype - Quickstart) or your IDE(IntelliJ IDEA).
3. POM.XML File
Running the Same Test on a Real Device
1. Prepare Your Device:
- Enable Developer Options and USB Debugging
- Connect via USB and authorize debugging.
- The above code needs Appium version 2.19.0
2. Update Desired Capabilities:
Your test should now run on the physical device.
Troubleshooting Common Issues
| Issue | Fix |
|---|---|
| Emulator not detected | Restart the emulator, check the adb devices |
| Appium server error | Restart the server, validate capabilities, and check the Java Client compatibility. |
| APK not installing | Check the path, permissions, or compatibility |
| Environment variable errors | Verify ANDROID_HOME, JAVA_HOME, and add to PATH |
Conclusion & What’s Next
Congratulations! You have just automated your first mobile test with Appium on both an emulator and a real device. In this journey, you’ve set up the environment, learned about ADB, and interacted with elements programmatically.
Related Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Apr 6, 2026
How We Built an AI System That Automates Senior Solution Architect Workflows
Discover how we built a 4-agent AI co-pilot that converts complex RFPs into draft technical proposals in 15 minutes — with built-in conflict detection, assumption surfacing, and confidence scoring.

Apr 6, 2026
AI Code Healer for Fixing Broken CI/CD Builds Fast
A deep dive into how GeekyAnts built an AI-powered Code Healer that analyzes CI/CD failures, summarizes logs, and generates code-level fixes to keep development moving.

Apr 2, 2026
A Real-Time AI Fraud Decision Engine Under 50ms
A deep dive into how GeekyAnts built a real-time AI fraud detection system that evaluates transactions in milliseconds using a hybrid multi-agent approach.

Apr 1, 2026
Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms
GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

Mar 31, 2026
Building a Self-Healing CI/CD System with an AI Agent
When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

Mar 26, 2026
Maestro Automation Framework — Advanced to Expert
Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.