private void waitForServerStart(final AndroidDevice device) {
    log.info("Waiting for the Selendroid server to start.");

    Wait<AndroidDevice> wait = new FluentWait<AndroidDevice>(device)
      .withTimeout(
        serverConfiguration.getServerStartTimeout(),
        TimeUnit.MILLISECONDS)
      .pollingEvery(
        serverConfiguration.getServerStartPollingInterval(),
        TimeUnit.MILLISECONDS);
    try {
      wait.until(new Function<AndroidDevice, Boolean>() {
        @Override
        public Boolean apply(AndroidDevice device) {
          if (!instrumentationProcessFinished()) {
            return device.isSelendroidRunning();
          }

          InstrumentationProcessOutput instrumentationOutput =
	           InstrumentationProcessOutput.parse(
              getInstrumentationProcessOutput());
          final Exception instrumentationError = getInstrumentationProcessError();
          if (instrumentationError != null) {
            throw new SelendroidException(
              "Failed to execute instrument command, full output:\n" +
              instrumentationOutput.getFullOutput(),
              instrumentationError);
          }

          throw InstrumentationProcessOutput.getInstrumentationProcessError(
            instrumentationOutput,
            device);
        }
      });
    } catch (TimeoutException e) {
      throw new SelendroidException(
        "Selendroid server didn't come up on the device after "
        + serverConfiguration.getServerStartTimeout() / 1000
        + " seconds");
    }

    log.info("Selendroid server has started.");
  }
This function will sign an android app and add it to the App Store. The function is made public because it also be
invoked by the Folder Monitor each time a new application dropped into this folder.

@param file
         - The file to be added to the app store
@throws AndroidSdkException
selendroid-standalone/src/main/java/io/selendroid/standalone/server/model/SelendroidStandaloneDriver.java