Package hudson.plugins.android_emulator
Class AndroidEmulatorContext
java.lang.Object
hudson.plugins.android_emulator.AndroidEmulatorContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intInterval during which an emulator command should complete. -
Constructor Summary
ConstructorsConstructorDescriptionAndroidEmulatorContext(AbstractBuild<?, ?> build_, Launcher launcher_, BuildListener listener_, AndroidSdk sdk_) -
Method Summary
Modifier and TypeMethodDescriptionintadbPort()intvoidcleanUp()intgetProcStarter(ArgumentListBuilder command) Sets up a standardLauncher.ProcStarterfor the current adb environment, ready to execute the given command.getProcStarter(ArgumentListBuilder command, EnvVars env) Sets up a standardLauncher.ProcStarterfor the current context.getToolCommand(SdkCliCommand sdkCmd) Generates a ready-to-use ArgumentListBuilder for one of the Android SDK tools, based on the current context.getToolProcStarter(SdkCliCommand sdkCmd) Generates a ready-to-use ProcStarter for one of the Android SDK tools, based on the current context.getToolProcStarter(SdkCliCommand sdkCmd, EnvVars env) Generates a ready-to-use ProcStarter for one of the Android SDK tools, based on the current context.launcher()listener()logger()process()sdk()booleansendCommand(String command) Sends a user command to the running emulator via its telnet interface.
Execution will be cancelled if it takes longer thanEMULATOR_COMMAND_TIMEOUT_MS.booleansendCommand(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.serial()voidsetProcess(Proc process) intuserPort()
-
Field Details
-
EMULATOR_COMMAND_TIMEOUT_MS
public static final int EMULATOR_COMMAND_TIMEOUT_MSInterval during which an emulator command should complete.- See Also:
-
-
Constructor Details
-
AndroidEmulatorContext
public AndroidEmulatorContext(AbstractBuild<?, ?> build_, Launcher launcher_, BuildListener listener_, AndroidSdk sdk_) throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
-
Method Details
-
cleanUp
public void cleanUp() -
adbPort
public int adbPort() -
userPort
public int userPort() -
adbServerPort
public int adbServerPort() -
getEmulatorCallbackPort
public int getEmulatorCallbackPort() -
serial
-
listener
-
launcher
-
sdk
-
logger
-
process
-
setProcess
-
getProcStarter
public Launcher.ProcStarter getProcStarter(ArgumentListBuilder command, EnvVars env) throws IOException, InterruptedException Sets up a standardLauncher.ProcStarterfor the current context.- Parameters:
command- What command to runenv- Additional environment variables to set- Returns:
- A ready ProcStarter
- Throws:
IOExceptionInterruptedException
-
getProcStarter
public Launcher.ProcStarter getProcStarter(ArgumentListBuilder command) throws IOException, InterruptedException Sets up a standardLauncher.ProcStarterfor the current adb environment, ready to execute the given command.- Parameters:
command- What command to run- Returns:
- A ready ProcStarter
- Throws:
IOExceptionInterruptedException
-
getToolCommand
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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedException
-
sendCommand
Sends a user command to the running emulator via its telnet interface.
Execution will be cancelled if it takes longer thanEMULATOR_COMMAND_TIMEOUT_MS.- Parameters:
command- The command to execute on the emulator's telnet interface.- Returns:
- Whether sending the command succeeded.
-
sendCommand
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.
-