ITargetCleaner

public interface ITargetCleaner
implements ITargetPreparer

com.android.tradefed.targetprep.ITargetCleaner
Known Indirect Subclasses
AbstractTargetCleaner An ITargetCleaner class with a stub setUp(ITestDevice, IBuildInfo) method  
AdditionalFilesInstaller A ITargetPreparer that pushes all getFiles() to specific path on device. 
AllTestAppsInstallSetup A ITargetPreparer that installs all apps from a getTestsDir() folder onto device. 
AppSetup A ITargetPreparer that installs an apk and its tests. 
CompanionAllocator Base class that takes care of allocating and freeing companion device

getCompanionDeviceSelectionOptions() should be implemented to describe the criteria needed to allocate the companion device  

CompanionRunCommandTargetPreparer A ITargetPreparer that runs specified commands on the allocated companion device  
CompanionTestAppInstallSetup A ITargetPreparer that installs one or more apps from a getTestsDir() folder onto an allocated companion device. 
CrashCollector A ITargetPreparer that runs crash collector on device which suppresses and logs crashes during test execution. 
DeviceCleaner Performs reboot or format as cleanup action after test, and optionally turns screen off  
DeviceFlashPreparer A ITargetPreparer that flashes an image on physical Android hardware. 
DeviceSetup A ITargetPreparer that configures a device for testing based on provided Options. 
FileCleaner A ITargetCleaner that removes filesystem files on teardown  
FolderSaver A ITargetCleaner that pulls directories off device, compresses and saves it into logging backend. 
NativeLeakCollector A ITargetCleaner that runs 'dumpsys meminfo --unreachable -a' to identify the unreachable native memory currently held by each process. 
PushFilePreparer A ITargetPreparer that attempts to push any number of files from any host path to any device path. 
RunCommandTargetPreparer  
TearDownPassThroughPreparer Allows for running tearDown on preparers that are included in a config as an object. 
TestAppInstallSetup A ITargetPreparer that installs one or more apps from a getTestsDir() folder onto device. 
TestJarInstaller A ITargetPreparer that pushes all .jar files it finds in the IBuildInfo to device. 
WifiPreparer A ITargetPreparer that configures wifi on the device if necessary. 


Cleans up the target device after the test run has finished.

For example, removes software, collects metrics, remove temporary files etc.

Note that multiple ITargetCleaners can be specified in a configuration.

Summary

Public methods

abstract void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)

Perform the target cleanup/teardown after testing.

Public methods

tearDown

void tearDown (ITestDevice device, 
                IBuildInfo buildInfo, 
                Throwable e)

Perform the target cleanup/teardown after testing.

Parameters
device ITestDevice: the ITestDevice to prepare.
buildInfo IBuildInfo: data about the build under test.
e Throwable: if the invocation ended with an exception, this will be the exception that was caught at the Invocation level. Otherwise, will be null.
Throws
DeviceNotAvailableException if device became unresponsive