private void cleanUpDevice(AndroidDevice emulator) throws Exception {
    emulator.uninstall(selendroidServer);
    emulator.uninstall(aut);
    String installedAPKs = listInstalledPackages();
    Assert.assertFalse(installedAPKs.contains(SELENDROID_SERVER_PACKAGE));
    Assert.assertFalse(installedAPKs.contains(AUT_PACKAGE));
  }
Works only if - android_home and java_home are set and - if one emulator is already running - and
selendroid project is build (apks are existent)

@author ddary
selendroid-standalone/src/test/java/io/selendroid/standalone/android/impl/DefaultHardwareDeviceTests.java