private void runInstrumentCommand(String[] args) {
    CommandLine command = adbCommand(ObjectArrays.concat(new String[]{"shell", "am", "instrument", "-w"}, args, String.class));

    try {
      ShellCommand.execAsync(null, command, new ShellCommand.Listener() {
        @Override
        public void onCommandExecutionFinished(int exitCode, String output) {
          for (InstrumentationProcessListener listener : instrumentationProcessListeners) {
            listener.onInstrumentationProcessComplete(output);
          }
        }

        @Override
        public void onCommandExecutionFailed(Exception error, String partialOutput) {
          for (InstrumentationProcessListener listener : instrumentationProcessListeners) {
            listener.onInstrumentationProcessFailed(partialOutput, error);
          }
        }
      });
    } catch(Exception e) {
      throw new SelendroidException("Failed to execute instrument command", e);
    }
  }
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