---
description: APPIUM is a freely distributed open source mobile application UI testing framework. Appium allows native, hybrid and web application testing and supports automation test on physical devices as well as
title: Appium Tutorial for Beginners
image: https://www.guru99.com/images/introduction-to-appium-1.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

Appium Tutorial for Android and iOS Mobile Apps Testing introduces an open-source UI automation framework that drives native, hybrid, and web apps on both platforms with a single Selenium-compatible API. This guide explains how Appium works, installation steps, the Inspector, emulator attachment, and a Java Calculator test case.

* 📱 **Core Definition:** Appium is an open-source mobile UI automation framework that supports native, hybrid, and web apps across Android and iOS through one API.
* 🔌 **HTTP Server Model:** Appium runs as a Node.js HTTP server that translates WebDriver JSON wire commands into platform-specific automation calls.
* 🧰 **Tooling Stack:** Required prerequisites include Android SDK, JDK, Eclipse, TestNG, Selenium Server JAR, the Appium client library, and Appium Desktop.
* 🔍 **Inspector and Recorder:** Appium Inspector inspects element hierarchies and generates boilerplate scripts, while UIAutomator Viewer is the Windows fallback.
* ☕ **Java Test Workflow:** Use DesiredCapabilities, RemoteWebDriver, and TestNG annotations to launch and validate native Android apps such as the Calculator.

[ Read More ](javascript:void%280%29;) 

![Appium Tutorial for Android and iOS Mobile Apps Testing]()

## What is Appium?

**Appium** is a freely distributed open-source mobile application UI [testing](https://www.guru99.com/software-testing.html) framework. Appium allows native, hybrid, and web application testing and supports automation on physical devices as well as on emulators and simulators. It offers cross-platform application testing — a single API works for both Android and iOS test scripts.

Appium has **no** dependency on the mobile device OS. The framework wraps and translates [Selenium](https://www.guru99.com/selenium-tutorial.html) WebDriver commands into UIAutomation (iOS) or UIAutomator (Android) commands depending on the device type, not the underlying operating system version.

Appium supports every language that has Selenium client libraries — Java, Objective-C, [JavaScript](https://www.guru99.com/interactive-javascript-tutorials.html) with Node.js, PHP, Ruby, Python, [C#](https://www.guru99.com/c-sharp-tutorial.html), and more.

## How Does Appium Work?

* Appium is an HTTP server written on the [Node.js](https://www.guru99.com/node-js-tutorial.html) platform that drives iOS and Android sessions using the WebDriver JSON wire protocol. Node.js must be pre-installed on the system before starting the Appium server.
* When Appium is downloaded and installed, a server is set up on the local machine that exposes a REST API.
* The server accepts connection and command requests from the client and executes the commands on a mobile device (Android or iOS).
* It responds with HTTP responses. To execute requests, Appium calls into native mobile-automation frameworks to drive the application UI:  
  * Apple Instruments for iOS (Instruments are available only in Xcode 3.0 or later with OS X v10.5 and later).
  * Google UIAutomator for Android API level 16 or higher.
  * Selendroid for Android API level 15 or lower.

## Prerequisites to Use Appium

1. Install **Android SDK** (Studio) \[[Link](http://developer.android.com/sdk/index.html)\].
2. Install **JDK** (Java Development Kit) \[[Link](https://www.guru99.com/install-java.html)\].
3. Install **Eclipse** \[[Link](http://www.eclipse.org/downloads/)\].
4. Install **TestNG** for Eclipse \[[Link](https://www.guru99.com/all-about-testng-and-selenium.html)\].
5. Install **Selenium Server JAR** \[[Link](https://www.guru99.com/introduction-to-selenium-grid.html)\].
6. **Appium Client Library** \[[Link](https://appium.io/docs/en/2.0/intro/clients/)\].
7. **APK App Info** on Google Play \[[Link](https://play.google.com/store/apps/details?id=com.wt.apkinfo&hl=en%5FUS&gl=US)\].
8. **Node.js** (not strictly required — when Appium Server is installed, Node.exe and NPM are bundled with the current Appium version).
9. Install **Appium Desktop**.

## Install Appium Desktop

Appium Desktop is an open-source GUI application that installs and runs the Appium Server. It comes bundled with all prerequisites needed to use the Appium Server, and it ships with an Inspector to surface basic information about your apps and a Recorder to generate boilerplate code that automates mobile applications.

**Step 1)** Go to <http://appium.io/> and click Download Appium.

[](https://www.guru99.com/images/1/image001.png)

**Step 2)** For Windows, select the .exe file and download it. The file is around 162 MB and will take time to download based on your internet speed.

[](https://www.guru99.com/images/1/image002.png)

**Step 3)** Click the downloaded .exe.

[](https://www.guru99.com/images/1/image003.png)

**Step 4)** On a Windows machine, there is no install wizard — Appium runs directly from the .exe. After you click the .exe, the following splash appears for a few minutes.

[](https://www.guru99.com/images/1/image004.gif)

For macOS, you need to install the .dmg.

**Step 5)** The Server Start window opens. It populates the default host and port (which you can change) and displays the Appium version in use.

[](https://www.guru99.com/images/1/image005.png)

**Step 6)** Click **Start Server**. A new server is launched on the specified host and port, and the server log output appears in the console.

[](https://www.guru99.com/images/1/image006.png)

**Step 7)** Click **New Session Window**.

[](https://www.guru99.com/images/1/image007.png)

**Step 8)** Enter the Desired Capabilities and start a session.

[](https://www.guru99.com/images/1/image008.png)

### RELATED ARTICLES

* [Robotium Tutorial: Your First Android Framework ](https://www.guru99.com/first-android-testing.html "Robotium Tutorial: Your First Android Framework")
* [Android APP Testing Tutorial with Automation Framework ](https://www.guru99.com/why-android-testing.html "Android APP Testing Tutorial with Automation Framework")
* [Appium Desired Capabilities for Android Emulator \[Example\] ](https://www.guru99.com/appium-desired-capabilities.html "Appium Desired Capabilities for Android Emulator [Example]")
* [Appium Maven Dependency: Installation with Project Example ](https://www.guru99.com/appium-maven.html "Appium Maven Dependency: Installation with Project Example")

## Appium Inspector

Similar to the Selenium IDE record-and-playback tool, Appium has an **Inspector** for recording and playing back tests. It records and plays native application behavior by inspecting the DOM and generates test scripts in any supported language. Note that Appium Inspector is not supported on Microsoft Windows: on Windows it launches the Appium Server but fails to inspect elements. UIAutomator Viewer is the recommended fallback for inspecting elements on Windows.

**Steps to start Appium Inspector on a Mac machine:**

**Step 1)** Download and start your Appium server using the default IP address 0.0.0.0 and the port 4725.

1. Select the source file or .app file from your local drive for testing.
2. Check the “App Path” checkbox to enable the “Choose” button.

**Step 2)** Click the “Choose” button to browse to and select the test file from the local drive.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio1.png)

**Step 3)** Start the iOS Simulator on the Mac machine.

**Step 4)** Click the **Launch** button in the top-right corner. This enables a blue icon — click that icon to open Appium Inspector and the Simulator with the pre-selected application.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio2.png)

**Step 5)** Once launched, Appium Inspector shows the element hierarchy in a column-wise structure. The user can also apply actions such as Tap, Swipe, and similar gestures.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio3.png)

**Step 6)** Click **Stop** to end recording.

## Attach an Android Emulator to Appium

**Step 1)** Install Android SDK on your system.

Open Control Panel > System and Security > System. From the left panel, click **Advanced System Settings**. In the System Properties pop-up, click the **Advanced** tab and then **Environment Variables**.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio4.png)

**Step 2)** From the Environment Variables pop-up, double-click **Path** and set the `ANDROID_HOME` variable to point to your SDK directory. Append the full SDK folder path. For example:

```
C:\User\ABC\Desktop\adt-bundled-windows-x86_64-20140321\sdk
```

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio5.png)

**Step 3)** Start an Android emulator, or attach an Android device to your system. Make sure USB debugging is enabled on the Android device: go to Device Settings > Developer Options > enable “USB Debugging”.

**Step 4)** Open Command Prompt and navigate to the Android SDK’s `\platform-tools\` directory (for example, `D:\adt-bundle-windows-x86_64-20130514\sdk\platform-tools`).

**Step 5)** Run the `adb devices` command. Your connected device will appear listed in the Command Prompt window. The full form is: `adb -s emulator-5554 install <Location of .apk file>`.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio6.png)

**Step 6)** Run the `adb start-server` command. The ADB server starts, and Appium will use it to send commands to your Android device.

**Step 7)** Navigate to the Appium directory on your system and start Appium by clicking the Appium.exe file.

**Step 8)** Do not alter the default IP address or port number. Click **Launch**. Your Appium console starts at 127.0.0.1:4723 as shown below.

[](https://www.guru99.com/images/1-2015/012315%5F1021%5FIntroductio7.png)

**Step 9)** Click **Start**. The Appium server is now running on your system.

## Appium Test Case for a Native Android App (Calculator)

**Step 1)** Download the ADT Eclipse plugin or grab the ADT bundle separately from [here](http://developer.android.com/tools/help/adt.html).

**Step 2)** Open Eclipse and create a new Project > Package > Class.

**Step 3)** Import the Selenium library and [TestNG](https://www.guru99.com/all-about-testng-and-selenium.html) into the new project.

**Step 4)** Create a small test program for **Calculator.app** that sums two numbers.

```
package src_Appium;

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.*;

public class Calculator {
    WebDriver driver;

    @BeforeClass
    public void setUp() throws MalformedURLException {
        // Set up desired capabilities and pass the Android app activity and package to Appium
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("BROWSER_NAME", "Android");
        capabilities.setCapability("VERSION", "4.4.2");
        capabilities.setCapability("deviceName", "Emulator");
        capabilities.setCapability("platformName", "Android");

        capabilities.setCapability("appPackage", "com.android.calculator2");
        // Package name of the app (get it from an APK info app)
        capabilities.setCapability("appActivity", "com.android.calculator2.Calculator");
        // Launcher activity of the app (get it from an APK info app)

        // Create a RemoteWebDriver instance and connect to the Appium server
        // Launches the Calculator app on the Android device using the capabilities above
        driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    }

    @Test
    public void testCal() throws Exception {
        // Locate the keys on the calculator by name
        WebElement two = driver.findElement(By.name("2"));
        two.click();
        WebElement plus = driver.findElement(By.name("+"));
        plus.click();
        WebElement four = driver.findElement(By.name("4"));
        four.click();
        WebElement equalTo = driver.findElement(By.name("="));
        equalTo.click();
        // Locate the calculator output by tag name
        WebElement results = driver.findElement(By.tagName("EditText"));
        // Check the calculated value on the edit box
        assert results.getText().equals("6") :
            "Actual value is : " + results.getText() + " did not match with expected value: 6";
    }

    @AfterClass
    public void teardown() {
        // Close the app
        driver.quit();
    }
}
```

Start the Appium Server and the Android Emulator from the AVD Manager, then click Run > TestNG. The program runs Calculator.app on the selected emulator and the result is displayed in the Eclipse console using the TestNG framework.

## Limitations of Appium

1. Appium does not support testing on Android versions lower than 4.2.
2. Limited support for hybrid app testing — for example, it is not possible to test the switching action between a web view and a native view in either direction.
3. No support for running Appium Inspector on Microsoft Windows.

## Common Errors and Troubleshooting Steps in Appium

| Error                                                                                                                  | Troubleshooting Steps                                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| error: The following desired capabilities are required, but were not provided: deviceName, platformName                | Add the desired capabilities deviceName and platformName to the Appium script. For example: capabilities.setCapability("deviceName", "Emulator"); and capabilities.setCapability("platformName", "Android"); |
| error: Could not find adb. Please set the ANDROID\_HOME environment variable with the Android SDK root directory path. | Set the SDK root directory in the system Environment Variables under the Path entry.                                                                                                                         |
| error: org.openqa.selenium.SessionNotCreatedException: A new session could not be created.                             | Set a correct App path and restart the Appium server.                                                                                                                                                        |
| How to find a DOM element or [XPath](https://www.guru99.com/xpath-selenium.html) in a mobile application?              | Use UIAutomator Viewer to inspect DOM elements for Android applications.                                                                                                                                     |

## FAQs

⚡ What is the difference between Appium and Selenium?

Selenium automates web browsers; Appium automates mobile applications. Appium reuses the WebDriver protocol so Selenium users adopt it quickly, but Appium also drives native, hybrid, and mobile-web apps on Android and iOS through platform-specific automation engines.

🚀 Which programming languages does Appium support?

Appium supports every language that has a Selenium WebDriver client, including Java, Python, JavaScript with Node.js, Ruby, C#, PHP, and Objective-C. This makes Appium adaptable across diverse engineering teams without forcing a language change.

💡 Can Appium test native, hybrid, and mobile-web apps?

Yes. Appium tests native apps installed on the device, hybrid apps with embedded web views, and mobile-web apps that run inside Chrome or Safari. A single WebDriver-based API drives all three types, which simplifies cross-platform test maintenance.

🤖 How does AI improve Appium test automation?

AI improves Appium suites through self-healing locators, visual validation, and AI-generated test steps. AI engines detect locator drift across app updates, recommend stable XPath alternatives, and auto-classify flaky tests so engineers can focus on real defects rather than maintenance.

🧠 Can AI generate Appium scripts from app screens automatically?

Yes. AI mobile-testing tools analyze app screens, identify interactive elements, and generate Appium scripts with desired capabilities and locators. Testers then review and refine the scripts, which reduces boilerplate and accelerates onboarding for teams new to Appium automation.

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/introduction-to-appium-1.png","url":"https://www.guru99.com/images/introduction-to-appium-1.png","width":"650","height":"250","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/introduction-to-appium.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/mobile-testing","name":"Mobile Apps Testing"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/introduction-to-appium.html","name":"Appium Tutorial for Beginners"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/introduction-to-appium.html#webpage","url":"https://www.guru99.com/introduction-to-appium.html","name":"Appium Tutorial for Beginners","dateModified":"2026-06-13T19:59:16+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/introduction-to-appium-1.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/introduction-to-appium.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/thomas","name":"Thomas Hamilton","description":"I am Thomas Hamilton, a seasoned professional in software testing, specializing in crafting comprehensive guides to help you master your software testing skills.","url":"https://www.guru99.com/author/thomas","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/thomas-hamilton-author-v2-120x120.png","url":"https://www.guru99.com/images/thomas-hamilton-author-v2-120x120.png","caption":"Thomas Hamilton","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"Mobile Apps Testing","headline":"Appium Tutorial for Beginners","description":"APPIUM is a freely distributed open source mobile application UI testing framework. Appium allows native, hybrid and web application testing and supports automation test on physical devices as well as","keywords":"mobile","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"NewsArticle","author":{"@id":"https://www.guru99.com/author/thomas","name":"Thomas Hamilton"},"dateModified":"2026-06-13T19:59:16+05:30","image":{"@id":"https://www.guru99.com/images/introduction-to-appium-1.png"},"copyrightYear":"2026","name":"Appium Tutorial for Beginners","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the difference between Appium and Selenium?","acceptedAnswer":{"@type":"Answer","text":"Selenium automates web browsers; Appium automates mobile applications. Appium reuses the WebDriver protocol so Selenium users adopt it quickly, but Appium also drives native, hybrid, and mobile-web apps on Android and iOS through platform-specific automation engines."}},{"@type":"Question","name":"Which programming languages does Appium support?","acceptedAnswer":{"@type":"Answer","text":"Appium supports every language that has a Selenium WebDriver client, including Java, Python, JavaScript with Node.js, Ruby, C#, PHP, and Objective-C. This makes Appium adaptable across diverse engineering teams without forcing a language change."}},{"@type":"Question","name":"Can Appium test native, hybrid, and mobile-web apps?","acceptedAnswer":{"@type":"Answer","text":"Yes. Appium tests native apps installed on the device, hybrid apps with embedded web views, and mobile-web apps that run inside Chrome or Safari. A single WebDriver-based API drives all three types, which simplifies cross-platform test maintenance."}},{"@type":"Question","name":"How does AI improve Appium test automation?","acceptedAnswer":{"@type":"Answer","text":"AI improves Appium suites through self-healing locators, visual validation, and AI-generated test steps. AI engines detect locator drift across app updates, recommend stable XPath alternatives, and auto-classify flaky tests so engineers can focus on real defects rather than maintenance."}},{"@type":"Question","name":"Can AI generate Appium scripts from app screens automatically?","acceptedAnswer":{"@type":"Answer","text":"Yes. AI mobile-testing tools analyze app screens, identify interactive elements, and generate Appium scripts with desired capabilities and locators. Testers then review and refine the scripts, which reduces boilerplate and accelerates onboarding for teams new to Appium automation."}}]}],"@id":"https://www.guru99.com/introduction-to-appium.html#schema-1114127","isPartOf":{"@id":"https://www.guru99.com/introduction-to-appium.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/introduction-to-appium.html#webpage"}}]}
```
