Using Appium 1.0 via command line on Windows 7 along with AVD API 19. Visual Studio with C# and NUnit as test runner
// Setup dummy capabilities to launch the Calculator app (this is only to use Appium to autolaunch the AVD before running tests on the stock browser--this will be fixed and not needed in next release of 1.0+)
DesiredCapabilities dummyCaps = new DesiredCapabilities();
dummyCaps.SetCapability("platformName", "Android");
dummyCaps.SetCapability("platformVersion", "4.4");
dummyCaps.SetCapability("deviceName", "Android Emulator");
dummyCaps.SetCapability("app", "Calculator.apk");
dummyCaps.SetCapability("appPackage", "com.android.calculator2");
dummyCaps.SetCapability("appActivity", "Calculator");
Driver.Quit(); // Kill the Driver connection established with the Calculator app
// Setup capabilities for launching the Android native Browser app
DesiredCapabilities appiumStockAndroidCapabilities = new DesiredCapabilities();
appiumStockAndroidCapabilities.SetCapability("platformName", "Android");
appiumStockAndroidCapabilities.SetCapability("platformVersion", "4.4");
appiumStockAndroidCapabilities.SetCapability("deviceName", "Android Emulator");
appiumStockAndroidCapabilities.SetCapability("browserName", "Browser");
I'm wondering if there is a way to have Appium close the Android emulator after the test suite has ran and completed their execution. Ideally I would like a fresh Android emulator to start upon kicking off a test and then close the emulator after the test has concluded.
I could always go down the route of killing emulator.exe processes at the conclusion of the test Teardown but I would prefer it if Appium could provide this functionality as I believe I've seen this implemented in the iPhone simulator on a Mac.