How to run tests on android emulator without loading the emulator everytime?
<p>How to run tests on Android emulator without loading the emulator everytime when I running tests?</p>

<p>I have the code:</p>

<pre><code>void prepareAndroidEmulator() throws MalformedURLException {
        File appDir = new File("/Users/oleh/Google Drive/QA DRIVE/Applications/some/sprint 2");
        File app = new File(appDir, BUILD_NAME);

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("avd", "LG_G4._API_22._Android_5.1");

        capabilities.setCapability("deviceName", "AndroidTestDevice");
        capabilities.setCapability("platformName", "Android");

        capabilities.setCapability("app", app.getAbsolutePath());
        driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    }
      @BeforeClass
    public void setUp() throws Exception {
        prepareAndroidEmulator();

    }

    @AfterClass
    public void tearDown() throws Exception {
        driver.quit();
        Runtime.getRuntime().exec("adb -s emulator-5554 emu kill");
    }
</code></pre>

<p>I kill emulator specially because if I don't do it, next time I have an error or ide is skipping tests.</p>

<p><a href="https://i.stack.imgur.com/SNItS.png" rel="nofollow noreferrer">Screen about skipped tests</a></p>

<p>Main idea: I don't want to load and kill emulator everytime when I starting tests. I want to load emulator once and after use it all time, when I running test.</p>

<p>My environment: </p>

<p>-OS X El Capitan
-Intellij IDEA
-Selenium
-Appium</p>