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:
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?
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With