public class

SdkAvdPreparer

extends Object
implements ITargetPreparer
java.lang.Object
   ↳ com.android.tradefed.targetprep.SdkAvdPreparer

Class Overview

A ITargetPreparer that will create an avd and launch an emulator

Summary

Public Constructors
SdkAvdPreparer()
Creates a SdkAvdPreparer.
Public Methods
String createAvd(ISdkBuildInfo sdkBuildInfo)
Finds SDK target based on the ISdkBuildInfo, creates AVD for this target and returns its name.
void launchEmulatorForAvd(ISdkBuildInfo sdkBuild, ITestDevice device, String avd)
Launch an emulator for given avd, and wait for it to become available.
void setGpu(boolean gpu)
Sets programmatically whether the gpu should be on or off.
void setUp(ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.targetprep.ITargetPreparer

Public Constructors

public SdkAvdPreparer ()

Creates a SdkAvdPreparer.

Public Methods

public String createAvd (ISdkBuildInfo sdkBuildInfo)

Finds SDK target based on the ISdkBuildInfo, creates AVD for this target and returns its name.

Parameters
sdkBuildInfo the ISdkBuildInfo
Returns
  • the created AVD name
Throws
TargetSetupError if could not get targets
BuildError if failed to create the AVD

public void launchEmulatorForAvd (ISdkBuildInfo sdkBuild, ITestDevice device, String avd)

Launch an emulator for given avd, and wait for it to become available.

Parameters
avd the avd to launch
Throws
DeviceNotAvailableException
TargetSetupError if could not get targets
BuildError if emulator fails to boot
DeviceNotAvailableException

public void setGpu (boolean gpu)

Sets programmatically whether the gpu should be on or off.

public void setUp (ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

Parameters
device the ITestDevice to prepare.
buildInfo data about the build under test.