Setting up mobile automation can be tricky, as each test requires specifying device, platform, and app details. Appium solves this with Desired Capabilities, which let you configure these parameters easily and run tests seamlessly across Android and iOS devices.
Overview
Desired Capabilities in Appium define the test environment by specifying details like device name, platform, and app under test.
Commonly used Desired Capabilities in Appium:
- platformName: Defines the OS (Android or iOS).
- platformVersion: Specifies the OS version of the device.
- deviceName: Identifies the target device (real or emulator/simulator).
- app: Path or URL of the mobile app (.apk or .ipa) to be tested.
- appPackage / appActivity (Android): Defines the package and main activity of the app.
- bundleId (iOS): Identifies the app under test on iOS.
- automationName: Chooses the automation engine (e.g., UiAutomator2, XCUITest).
- udid: Unique device identifier for running tests on a real device.
- noReset: Controls whether to retain app data between sessions.
- fullReset: Ensures the app is uninstalled and reinstalled before each session.
This article explores Desired Capabilities in Appium, along with commonly used capabilities for Android and iOS testing.
What are Desired Capabilities in Appium?
Desired Capabilities in Appium refer to the combination of key-value pairs encoded in a JSON object. These key-value pairs are defined by the QAs to request the Appium server for the desired test automation session.
Here’s an example of Desired Capabilities in Appium represented as a JSON object.
{ “platformName”: “Android”, “platformVersion”: “10.0”, “deviceName”: “Samsung Galaxy Note10”, “automationName”: “Appium”, “app”: “path for the app under test” }
Using the above mentioned Desired Capabilities, the user is instructing the drivers to start the test automation session for the app at the mentioned path on a Samsung Galaxy Note 10 with Android version 10.0 using Appium.
As Appium supports both Android and iOS, it has a unique set of Capabilities for both platforms. The tables below mention commonly used Capabilities for Android and iOS.
Common Capabilities in Android
Capabilities | Description | Values |
appPackage | Represents the Java package of the desired Android App to be tested | com.example.android.myApp, com.android.settings |
appActivity | Represents the name of the desired activity to be launched from the package. It needs to be preceded by a ‘.’ | .MainActivity, .Settings |
appWaitPackage | Represents the java package of Android App to wait for | com.example.android.myApp, com.android.settings |
browserName | Represents the name of the mobile web browser to be automated. The value should be an empty string if automating an app | ‘Safari’ for iOS |
Common Capabilities in iOS
Capabilities | Description | Values |
udid | Unique identifier of the connected physical device | e.g 1ae203187fc012g |
autoAcceptAlerts | Accept all iOS alerts automatically if they pop up. The default value is false | true or false |
safariInitialUrl | Initial URL to be loaded. The default URL redirects to a local home page | e.g. https://www.github.com |
Scaling Appium Testing with BrowserStack
Market trends in mobile technology evolve rapidly, requiring teams to ensure their apps are compatible with the latest devices and platforms. To achieve this, mobile apps must be tested extensively across a wide range of real Android and iOS devices.
At the same time, faster release cycles are critical to staying competitive. In this landscape, BrowserStack enables teams to deliver quality at speed by providing instant access to 3500+ real Android and iOS devices on the cloud.
Instead of maintaining costly in-house device labs, QA teams can run manual and automated tests in parallel on real devices, integrate seamlessly with CI/CD pipelines, and debug faster with detailed logs, screenshots, and video recordings.
Moreover, BrowserStack provides a Capabilities Generator that simplifies the process of creating Appium Desired Capabilities for iOS and Android.
By selecting the OS, device, and preferred programming language, teams can generate the exact capabilities needed in seconds.
Conclusion
Desired Capabilities in Appium are essential for configuring test environments and ensuring smooth automation across Android and iOS platforms. By separating environment details from test logic, they make test execution more flexible, scalable, and maintainable.
To maximize the impact of data-driven testing with Appium, teams can leverage BrowserStack’s real device cloud. It provides instant access to thousands of real devices and browsers, enabling parallel execution, seamless CI/CD integration, and faster debugging. This combination empowers teams to deliver high-quality mobile apps at speed, with complete confidence in real-world performance.