Class AndroidEmulatorContext

java.lang.Object
hudson.plugins.android_emulator.AndroidEmulatorContext

public class AndroidEmulatorContext extends Object
  • Field Details

    • EMULATOR_COMMAND_TIMEOUT_MS

      public static final int EMULATOR_COMMAND_TIMEOUT_MS
      Interval during which an emulator command should complete.
      See Also:
  • Constructor Details

  • Method Details

    • cleanUp

      public void cleanUp()
    • adbPort

      public int adbPort()
    • userPort

      public int userPort()
    • adbServerPort

      public int adbServerPort()
    • getEmulatorCallbackPort

      public int getEmulatorCallbackPort()
    • serial

      public String serial()
    • listener

      public BuildListener listener()
    • launcher

      public Launcher launcher()
    • sdk

      public AndroidSdk sdk()
    • logger

      public PrintStream logger()
    • process

      public Proc process()
    • setProcess

      public void setProcess(Proc process)
    • getProcStarter

      public Launcher.ProcStarter getProcStarter(ArgumentListBuilder command, EnvVars env) throws IOException, InterruptedException
      Sets up a standard Launcher.ProcStarter for the current context.
      Parameters:
      command - What command to run
      env - Additional environment variables to set
      Returns:
      A ready ProcStarter
      Throws:
      IOException
      InterruptedException
    • getProcStarter

      Sets up a standard Launcher.ProcStarter for the current adb environment, ready to execute the given command.
      Parameters:
      command - What command to run
      Returns:
      A ready ProcStarter
      Throws:
      IOException
      InterruptedException
    • getToolCommand

      public ArgumentListBuilder getToolCommand(SdkCliCommand sdkCmd)
      Generates a ready-to-use ArgumentListBuilder for one of the Android SDK tools, based on the current context.
      Parameters:
      sdkCmd - The Android tool and any extra arguments for the command to run.
      Returns:
      Arguments including the full path to the SDK and any extra Windows stuff required.
    • getToolProcStarter

      public Launcher.ProcStarter getToolProcStarter(SdkCliCommand sdkCmd, EnvVars env) throws IOException, InterruptedException
      Generates a ready-to-use ProcStarter for one of the Android SDK tools, based on the current context.
      Parameters:
      sdkCmd - The Android tool and any extra arguments for the command to run.
      env - Additional environment variables to set
      Returns:
      A ready ProcStarter
      Throws:
      IOException
      InterruptedException
    • getToolProcStarter

      public Launcher.ProcStarter getToolProcStarter(SdkCliCommand sdkCmd) throws IOException, InterruptedException
      Generates a ready-to-use ProcStarter for one of the Android SDK tools, based on the current context.
      Parameters:
      sdkCmd - The Android tool and any extra arguments for the command to run.
      Returns:
      A ready ProcStarter
      Throws:
      IOException
      InterruptedException
    • sendCommand

      public boolean sendCommand(String command)
      Sends a user command to the running emulator via its telnet interface.
      Execution will be cancelled if it takes longer than EMULATOR_COMMAND_TIMEOUT_MS.
      Parameters:
      command - The command to execute on the emulator's telnet interface.
      Returns:
      Whether sending the command succeeded.
    • sendCommand

      public boolean sendCommand(String command, int timeout)
      Sends a user command to the running emulator via its telnet interface.
      Execution will be cancelled if it takes longer than timeout ms.
      Parameters:
      command - The command to execute on the emulator's telnet interface.
      timeout - The command's timeout, in ms.
      Returns:
      Whether sending the command succeeded.