Start for free Deutsch Log in Register
Please try again later or contact us. Thank you very much!

Subscribe to the newsletter to be informed about important technical updates to the Mobile Device Cloud.

* mandatory information


Test automation with Appium & Jetpack Compose

The use of the following test frameworks and test tools has been evaluated and tested. Other common frameworks and test tools are under evaluation. If you have any questions about using your preferred test tools, please feel free to contact us.

Appium Appium + Jetpack Compose XCUITest Espresso TestCafe Tosca Selenium Testerra

Test your Android Jetpack Compose app with Appium on the Mobile Device Cloud devices

To test a Jetpack Compose app with Appium, the corresponding Espresso driver must be used.

The following description shows you the procedure:

import io.appium.java_client.AppiumBy;
import org.junit.*;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;


public class EspressoTest {

    private final String CLOUD_ACCESS_KEY = "<ACCESS_KEY>";
    private final String APP_PATH = "cloud:<APP_BUNDLE_ID>";
    protected AndroidDriver driver = null;
    private final DesiredCapabilities dc = new DesiredCapabilities();

    public void setUp() throws MalformedURLException {
        dc.setCapability("accessKey", CLOUD_ACCESS_KEY);
        dc.setCapability("app", APP_PATH);
        dc.setCapability("espressoServerUniqueName", ESPRESSO_SERVER);

        dc.setCapability("platformName", "Android");
        dc.setCapability("automationName", "Espresso");
        dc.setCapability("deviceQuery", "@os='android' and @category='PHONE'");
        dc.setCapability("testName", "Quick Start Espresso Demo");
        dc.setCapability("appium:appiumVersion", "2.0.0.beta.23");

        driver = new AndroidDriver(new URL(""), dc);
        driver.setSetting("driver", "compose");

    public void quickStartEspressoDemo() {
        WebElement text = driver.findElement(AppiumBy.tagName("myTextTag"));
        Assert.assertEquals("Hello Espresso!", text.getText());

        driver.findElement(AppiumBy.tagName("myInputTag")).sendKeys("Mobile Device Cloud");

        WebElement keywords = driver.findElement(AppiumBy.tagName("myKeywordsTag"));
        Assert.assertEquals("Mobile Device Cloud", keywords.getText());

    public void tearDown() {
        System.out.println("Report URL: "+ driver.getCapabilities().getCapability("reportUrl"));

First steps with Appium + Jetpack Compose


Download demo project


Install Espresso Driver


Complete missing information


Run setup


Upload apps


Start tests

1. Download demo project

Download our Demo project and import it into your IDE for a smooth start.

2. Install Espresso Driver

In addition to your app to be tested, a server app is also required for Espresso tests. This is built automatically by the Espresso driver for Appium. For this, you need to install a local Appium server. Download Node.js and NPM and install it.

Then install Appium 2 and the Espresso driver in the terminal using the following commands:

npm install -g appium@next
appium driver install espresso

Now start the Appium server with the command:


The following messages should now appear:

  • Appium 2 was launched
  • The Espresso driver has been loaded
  • The REST interface is available
Mobile Device Cloud

3. Complete missing information

Open the File. In this file there are two placeholders that you have to fill:

<LOCAL_APPIUM_SERVER>: The URL to the REST interface of your local Appium server. This is displayed in the terminal when the server is started. (e.g.

<APK_PATH>: The path to the APK file of your app that you previously generated with Android Studio. (Build → Build APK)

4. Run setup

Start an emulator in Android Studio or connect a real Android device to your computer.

Start the file either in run or debug mode. The setup is complete when the tests have run successfully.

During the setup, some information is displayed in the Appium Server terminal. This includes the line:

"Installing Espresso Test Server apk from the target device ..." with a path to the Espresso server APK. Copy this APK together with the APK of your app into a common folder to find them again later.

NOTE: The Espresso server depends heavily on your app. Therefore, it must always be rebuilt using the setup if dependencies in your app change.

Mobile Device Cloud

5. Upload apps

Upload your app and the Espresso server to the Mobile Device Cloud.

Assign a unique name to the Espresso server.

6. Start tests

Fill in the placeholders in the file with your data.

Start the tests in Run or Debug mode. These are now executed in the Mobile Device Cloud.

You can use the examples to implement your own tests!