public interface ITargetCleaner
implements ITargetPreparer
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. 
DeviceStorageFiller Target preparer to fill up storage so some amount of free space is available. 
DeviceStringPusher Target preparer to write a string to a file. 
FileCleaner A ITargetCleaner that removes filesystem files on teardown  
FolderSaver A ITargetCleaner that pulls directories off device, compresses and saves it into logging backend. 
InstallAllTestZipAppsSetup A ITargetPreparer that installs all apps in a test zip. 
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. 
RestartSystemServerTargetPreparer Target preparer that restarts the system server without rebooting the device. 
RootTargetPreparer Target preparer that performs "adb root". 
RunHostCommandTargetPreparer Target preparer to run arbitrary host commands before and after running the test. 
SuiteApkInstaller Installs specified APKs for Suite configuration: either from $ANDROID_TARGET_OUT_TESTCASES variable or the ROOT_DIR in build info. 
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. 
TimeSetterTargetPreparer Target preparer to restore the correct time to the device on cleanup. 
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.


Public methods

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

Perform the target cleanup/teardown after testing.

Public methods


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

Perform the target cleanup/teardown after testing.

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.

DeviceNotAvailableException if device became unresponsive