1

I am using Appium + WebDriverIO to run E2E tests for a React Native app.

When I run the tests on iOS, it will automatically launch the specified iOS simulator, but for Android I have to manually launch the emulator before running the tests.

I am running the following command:

npx wdio run wdio.conf.js

My wdio.conf.js looks like this:

export const config = {
    capabilities: [
        // Android
        {
            platformName: "Android",
            app: "./path/to/apk/app-debug.apk",
            deviceName: "Pixel_4_API_30",
            platformVersion: "11.0",
        },

        // iOS
        {
            platformName: "iOS",
            automationName: "XCUITest",
            deviceName: "iPhone 11",
            platformVersion: "13.5",
            app: "./path/to/app/My App Name.app",
        },
    ],

    // ...
};

The deviceName (Pixel_4_API_30) is taken from the output of running emulator -list-avds.

I am running on MacOS.

How can I make the Android emulator launch automatically?

twiz
  • 9,041
  • 8
  • 52
  • 84

1 Answers1

0

To launch the Android emulator automatically, you need to add the following capabilities.

avd: "Pixel_4_API_30"
{
     platformName: "Android",
     app: "./path/to/apk/app-debug.apk",
     deviceName: "Pixel_4_API_30",
     platformVersion: "11.0",
     avd: "Pixel_4_API_30"
},

For more capabilities, refer the documentation: http://appium.io/docs/en/writing-running-appium/caps/

Thangaraj
  • 11
  • 3