Package hudson.plugins.android_emulator
Class AndroidEmulatorContext
java.lang.Object
hudson.plugins.android_emulator.AndroidEmulatorContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Interval during which an emulator command should complete. -
Constructor Summary
ConstructorsConstructorDescriptionAndroidEmulatorContext
(AbstractBuild<?, ?> build_, Launcher launcher_, BuildListener listener_, AndroidSdk sdk_) -
Method Summary
Modifier and TypeMethodDescriptionint
adbPort()
int
void
cleanUp()
int
getProcStarter
(ArgumentListBuilder command) Sets up a standardLauncher.ProcStarter
for the current adb environment, ready to execute the given command.getProcStarter
(ArgumentListBuilder command, EnvVars env) Sets up a standardLauncher.ProcStarter
for 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()
boolean
sendCommand
(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
.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.serial()
void
setProcess
(Proc process) int
userPort()
-
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:
InterruptedException
IOException
-
-
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.ProcStarter
for the current context.- Parameters:
command
- What command to runenv
- Additional environment variables to set- Returns:
- A ready ProcStarter
- Throws:
IOException
InterruptedException
-
getProcStarter
public Launcher.ProcStarter getProcStarter(ArgumentListBuilder command) throws IOException, InterruptedException Sets up a standardLauncher.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
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
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.
-