@Override
  public void install(AndroidApp app) throws AndroidSdkException {
    // Uninstall if already installed
    if (isInstalled(app)) {
      uninstall(app);
    }
    // -r: replace existing application
    // -d: allow version code downgrade
    CommandLine command = adbCommand("install", "-r", "-d", app.getAbsolutePath());

    String out = executeCommandQuietly(command, COMMAND_TIMEOUT * 6);
    try {
      // give it a second to recover from the install
      Thread.sleep(1000);
    } catch (InterruptedException ie) {
      throw new RuntimeException(ie);
    }
    if (!out.contains("Success")) {
      throw new AndroidSdkException("APK installation failed. Output:\n" + out);
    }
  }
Constructor mean to be used with Android Hardware devices because a reference to the
{@link IDevice} will be available immediately after they are connected.

@param device
selendroid-standalone/src/main/java/io/selendroid/standalone/android/impl/AbstractDevice.java