---
description: This tutorial will help you to understand APPIUM automation tool. It will cover desired capabilities and APPIUM with Maven uses. In this tutorial, you will learn- What is Desired Capabilities Extracti
title: Appium Desired Capabilities for Android Emulator
image: https://www.guru99.com/images/appium-desired-capabilities.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

Desired capabilities are the key-value pairs an Appium client sends when it opens a session, telling the server which platform, device, driver and application the automated test should run against.

* 🔴 **Session contract:** Capabilities travel in the JSON body of the new-session request and cannot be changed afterwards.
* ☑️ **Android essentials:** appPackage and appActivity name the application and the screen Appium should launch.
* ✅ **Wait variants:** appWaitPackage and appWaitActivity cover splash screens that appear before the real entry point.
* 🧪 **Appium 2 prefix:** Every non-standard capability now needs the appium: vendor prefix, or the server rejects it.
* 🛠️ **Modern Java client:** DesiredCapabilities gave way to UiAutomator2Options and XCUITestOptions under Selenium 4.
* 📊 **Finding values:** An adb dumpsys query or the PackageManager class reveals the package and activity names.

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

![Appium desired capabilities key-value pairs for an Android emulator session](https://www.guru99.com/images/appium-desired-capabilities.png) 

## What is Desired Capabilities

‘Desired Capabilities’ help us modify the behaviour of the server during automation. In Appium it is a hashmap, or key-value pair, used to send a command to the Appium server, where every client command runs in the context of a session.

For example, a client sends a POST /session request containing a JSON object to the Appium server.

So, to send a request or maintain a session with the server, a set of key and value pairs is used. This is known as ‘Desired Capabilities’.

import io.appium.java_client.AppiumDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
{
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName","Android Emulator");
        capabilities.setCapability("platformVersion", "4.4");
}

**Important Role of Desired Capability**

* ‘DesiredCapabilities’ help the user control the session request with the server. For example, for an iOS session we set the capability platformName = iOS, and for an Android session platformName = Android.
* ‘DesiredCapabilities’ are used to set up the WebDriver instance, for example FirefoxDriver, ChromeDriver or InternetExplorerDriver.
* DesiredCapability is very useful for [Selenium](https://www.guru99.com/selenium-tutorial.html) Grid. For example, it is used to run different test cases on a different browser and a different operating system. Based on the stated capability, the Grid hub points to the corresponding node. Nodes are defined using the ‘set’ property methods:  
DesiredCapabilities obj = new DesiredCapabilities();  
obj.setBrowserName("firefox");  
obj.setVersion("18.0.1");  
obj.setPlatform(org.openqa.selenium.Platform.WINDOWS);
* A desired capability is a library-defined package. Before using ‘DesiredCapabilities’, it should be imported from the library below.  
Org.openqa.selenium.remote.DesiredCapabilities

Appium supports both Android and iOS, so there is a separate set of Appium server capabilities for each platform.

The table below shows some commonly used Android capabilities and the values to use.

| Capabilities    | Description                                                                                                      | Values/Uses                                                                                            |
| --------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| appPackage      | Call the desired [Java](https://www.guru99.com/java-tutorial.html) package in Android that the user wants to run | Value= com.example.myapp/ Obj.setCapability(“appPackage”, “com.whatsapp”);                             |
| appActivity     | Application activity that the user wants to launch from the package.                                             | Value= MainActivity, .Settings Obj.setCapability(“appActivity”, “com.whatsapp.Main”);                  |
| appWaitPackage  | Package that the application needs to wait for                                                                   | Value=com.example.android.myapp                                                                        |
| appWaitActivity | Any Android activity that the user needs to wait for                                                             | Value= SplashActivity capabilities.setCapability(“appWaitActivity”, “com.example.game.SplashActivity”) |

NOTE: refer to the [Appium documentation](https://appium.io/docs/en/2.0/) to view more Android capabilities.

The table below shows some commonly used iOS capabilities and the values to use.

| Capabilities  | Description                                                         | Values    |
| ------------- | ------------------------------------------------------------------- | --------- |
| LaunchTimeout | Total time (in ms) to wait for instrumentation.                     | 2000      |
| UDID          | To identify the unique device number of a connected physical device | 166aestu4 |

NOTE: refer to the [Appium capabilities guide](https://appium.io/docs/en/2.0/guides/caps/) to view more iOS capabilities.

## How Desired Capabilities Changed in Appium 2

The examples above come from the Appium 1 era and still show the shape of a capability set, but two rules changed and both will stop a modern session from starting.

First, the W3C WebDriver specification defines only a small set of standard capabilities, of which `platformName` and `browserName` matter here. Every other capability is a vendor extension and must carry a namespace prefix ending in a colon. Appium’s prefix is `appium:`. So `deviceName` becomes `appium:deviceName` and `platformVersion` becomes `appium:platformVersion`. Appium 2 also requires `appium:automationName`, because drivers are installed separately rather than bundled with the server.

Second, repeating the prefix gets tedious, so Appium accepts a single `appium:options` capability whose value is an object. Capabilities inside that object need no prefix, and where a name appears both inside and outside the object, the inner value wins.

{
    "platformName": "iOS",
    "appium:options": {
        "automationName": "XCUITest",
        "platformVersion": "16.0",
        "app": "/path/to/your.app",
        "deviceName": "iPhone 12",
        "noReset": true
    }
}

⚠️ **Version note:** on the Java side, Selenium 4 and Appium Java client 8 deprecated the `DesiredCapabilities` class shown earlier. Driver-specific builders inherited from `BaseOptions` replace it — `UiAutomator2Options` for Android and `XCUITestOptions` for iOS — with a one-to-one mapping from each old `setCapability` call. The original code above is kept here as the historical example.

## Extracting Packages & Activities information

Packages are bundled files or classes. They give an organised structure to modular programming. In Java, different packages are stored in a single JAR file, and the user can call that JAR for full execution. A similar concept is followed in mobile application development.

In the Android operating system, all applications are installed in the form of Java packages. So, to extract package path information, the Android PackageManager class is used.

It retrieves package and activity information for pre-installed and post-installed applications on the device.

You can get an instance of the PackageManager class by calling getPackageManager(). This method can access and manipulate the packages and related permissions of the installed applications.

For example:

PackageManager pManager = getPackageManager();
List<ApplicationInfo> list = pManager.getInstalledApplications(PackageManager.GET_META_DATA)

## How to Find appPackage and appActivity with adb

The PackageManager route above works from inside an application. As a tester you usually have only the installed build, so the quicker path is a query over [adb](https://www.guru99.com/adb-connect.html) against a connected device or emulator.

Open the application on the device by hand, then run one of the commands below from a terminal in the platform-tools folder. The command prints the window that currently has focus, and the value is formatted as `package/activity`.

adb shell dumpsys window | find "mCurrentFocus"
adb shell dumpsys window windows | grep -i "mCurrentFocus"

Use the first form in the Windows command prompt and the second in a Unix shell or Git Bash. Read the result as two halves: everything before the slash is the value for `appPackage`, and everything after it is the value for `appActivity`.

Two cautions apply. The focused activity is whatever is on screen at that moment, which is not always the activity the application starts with — if a session fails during driver initialisation, launch the app fresh and read the value again. And if a splash screen appears first, the entry activity will differ from the one you eventually want to assert against, which is exactly the case `appWaitActivity` exists for.

A visual alternative is [uiautomatorviewer](https://www.guru99.com/uiautomatorviewer-tutorial.html), which captures the current screen hierarchy and shows the package and class of every node.

### RELATED ARTICLES

* [iOS Automation Testing with Xcode UI Framework ](https://www.guru99.com/ios-test-program-uiautomation-framework.html "iOS Automation Testing with Xcode UI Framework")
* [Robotium Tutorial: Android Testing Framework with Example ](https://www.guru99.com/first-android-testing.html "Robotium Tutorial: Android Testing Framework with Example")
* [Selendroid Tutorial for Beginners with Example ](https://www.guru99.com/introduction-to-selendroid.html "Selendroid Tutorial for Beginners with Example")
* [Appium Maven Dependency: Setup with Eclipse Project Example ](https://www.guru99.com/appium-maven.html "Appium Maven Dependency: Setup with Eclipse Project Example")

## Common Desired Capabilities Errors and How to Fix Them

Most failed Appium sessions end before a single test step runs, and the cause is almost always in the capability set rather than in the test. The table below maps each message to its usual fix.

| **Message**                                                                         | **Likely cause**                                             | **Fix**                                                         |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------- |
| Invalid or unsupported WebDriver capability                                         | A non-standard capability was sent without the vendor prefix | Add appium: to it, or move it inside appium:options             |
| The desired capabilities must include either an automationName or a platformName    | Appium 2 cannot pick a driver                                | Set platformName and appium:automationName explicitly           |
| Cannot start the app. Original error: activity used to start the app does not exist | appActivity does not match the manifest                      | Re-read the value with the dumpsys command above                |
| Session did not start: no devices found                                             | No emulator or handset is attached                           | Confirm the device with adb devices before launching            |
| A new session could not be created after the timeout                                | A splash screen delays the entry activity                    | Set appWaitActivity and raise appWaitDuration                   |
| Application state is not reset between runs                                         | Default reset behaviour was overridden                       | Review appium:noReset and appium:fullReset for the run you want |

When a session refuses to start, read the Appium server log rather than the client stack trace. The server states which capability it could not satisfy, and that line names the fix.

## FAQs

🔑 Does platformName need the appium: prefix?

No. platformName and browserName are standard W3C capabilities and stay unprefixed. Every other Appium capability, including deviceName and platformVersion, is a vendor extension and needs the appium: prefix.

🤖 Can AI generate a capability set for a new device?

Machine learning tools in device clouds suggest a capability set from the build and target device, and flag values that failed on similar sessions. Treat the output as a draft and confirm each name against the driver documentation.

🧑‍💻 Does GitHub Copilot know the appium: capability names?

Copilot completes common capability blocks, but it was trained on a lot of Appium 1 code and often omits the prefix or suggests the deprecated DesiredCapabilities class. Check each suggestion against the current guide.

📱 What is the difference between appPackage and appWaitPackage?

appPackage names the package Appium launches. appWaitPackage names the package Appium waits to appear before returning control, which matters when a launcher or splash screen loads a different package first.

🍏 Which capabilities are required for an iOS session?

platformName set to iOS and appium:automationName set to XCUITest. The XCUITest driver also needs at least one of appium:app, appium:bundleId or browserName, otherwise it opens a session on the home screen.

⏱️ What does newCommandTimeout control?

The number of seconds the server waits for the client to send its next command. If the wait is exceeded, the server assumes the client is gone and shuts the session down, which often looks like a random failure.

🔄 What is the difference between noReset and fullReset?

noReset skips the usual reset so app data survives the session. fullReset adds extra steps, uninstalling and reinstalling, for maximum reproducibility. Both default to false and should not be enabled together.

🧩 Can capabilities be changed after a session starts?

No. Capabilities are parameters for starting the session and are fixed once it is created. Where a driver allows a behaviour to change mid-session, it exposes a Setting through the Settings API instead.

#### 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/appium-desired-capabilities.png","url":"https://www.guru99.com/images/appium-desired-capabilities.png","width":"700","height":"250","caption":"Appium Desired Capabilities","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/appium-desired-capabilities.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/appium-desired-capabilities.html","name":"Appium Desired Capabilities for Android Emulator"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/appium-desired-capabilities.html#webpage","url":"https://www.guru99.com/appium-desired-capabilities.html","name":"Appium Desired Capabilities for Android Emulator","dateModified":"2026-07-30T11:24:44+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/appium-desired-capabilities.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/appium-desired-capabilities.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 Desired Capabilities for Android Emulator","description":"This tutorial will help you to understand APPIUM automation tool. It will cover desired capabilities and APPIUM with Maven uses. In this tutorial, you will learn- What is Desired Capabilities Extracti","keywords":"mobile","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/thomas","name":"Thomas Hamilton"},"dateModified":"2026-07-30T11:24:44+05:30","image":{"@id":"https://www.guru99.com/images/appium-desired-capabilities.png"},"copyrightYear":"2026","name":"Appium Desired Capabilities for Android Emulator","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"Does platformName need the appium: prefix?","acceptedAnswer":{"@type":"Answer","text":"No. platformName and browserName are standard W3C capabilities and stay unprefixed. Every other Appium capability, including deviceName and platformVersion, is a vendor extension and needs the appium: prefix."}},{"@type":"Question","name":"Can AI generate a capability set for a new device?","acceptedAnswer":{"@type":"Answer","text":"Machine learning tools in device clouds suggest a capability set from the build and target device, and flag values that failed on similar sessions. Treat the output as a draft and confirm each name against the driver documentation."}},{"@type":"Question","name":"Does GitHub Copilot know the appium: capability names?","acceptedAnswer":{"@type":"Answer","text":"Copilot completes common capability blocks, but it was trained on a lot of Appium 1 code and often omits the prefix or suggests the deprecated DesiredCapabilities class. Check each suggestion against the current guide."}},{"@type":"Question","name":"What is the difference between appPackage and appWaitPackage?","acceptedAnswer":{"@type":"Answer","text":"appPackage names the package Appium launches. appWaitPackage names the package Appium waits to appear before returning control, which matters when a launcher or splash screen loads a different package first."}},{"@type":"Question","name":"Which capabilities are required for an iOS session?","acceptedAnswer":{"@type":"Answer","text":"platformName set to iOS and appium:automationName set to XCUITest. The XCUITest driver also needs at least one of appium:app, appium:bundleId or browserName, otherwise it opens a session on the home screen."}},{"@type":"Question","name":"What does newCommandTimeout control?","acceptedAnswer":{"@type":"Answer","text":"The number of seconds the server waits for the client to send its next command. If the wait is exceeded, the server assumes the client is gone and shuts the session down, which often looks like a random failure."}},{"@type":"Question","name":"What is the difference between noReset and fullReset?","acceptedAnswer":{"@type":"Answer","text":"noReset skips the usual reset so app data survives the session. fullReset adds extra steps, uninstalling and reinstalling, for maximum reproducibility. Both default to false and should not be enabled together."}},{"@type":"Question","name":"Can capabilities be changed after a session starts?","acceptedAnswer":{"@type":"Answer","text":"No. Capabilities are parameters for starting the session and are fixed once it is created. Where a driver allows a behaviour to change mid-session, it exposes a Setting through the Settings API instead."}}]}],"@id":"https://www.guru99.com/appium-desired-capabilities.html#schema-1155455","isPartOf":{"@id":"https://www.guru99.com/appium-desired-capabilities.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/appium-desired-capabilities.html#webpage"}}]}
```
