Do we need to manually start the Android emulator for Appium?

10,421

In your settings enable "Launch AVD" and enter the name of the Android Virtual Device you created. This will start the emulator (if it's not already started) whenever you start a test.

Update:

You need to set the AVD capability. Simply add this line to your code capabilities.setCapability("avd","AndroidTestDevice");

Share:
10,421
msiles
Author by

msiles

Updated on June 26, 2022

Comments

  • msiles
    msiles almost 2 years

    I'm new to appium and I'm running the calculator example test using the following code:

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName","AndroidTestDevice");
    capabilities.setCapability("platformName","Android");    
    capabilities.setCapability("appPackage", "com.android.calculator2");       
    capabilities.setCapability("appActivity","com.android.calculator2.Calculator");
    driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
    

    Appium is running as you can see in the following screenshot:

    enter image description here

    If the emulator is not running, I get the error related to no devices found. My question is:

    Do I need to manually start the emulator every time I need to execute a test? or Does appium will start the android emulator when the test is executed?

    enter image description here