to top
public class

AppSetup

extends Object
implements ITargetPreparer ITargetCleaner @OptionClass(alias = "app-setup")
java.lang.Object
   ↳ com.android.tradefed.targetprep.AppSetup

Class Overview

A ITargetPreparer that installs an apk and its tests.

Requires 'aapt' on PATH when --uninstall is set

Summary

Fields
private boolean mInstall @Option(name = "install", description = "install all apks in build.")
private ArrayList<String> mInstallFlags @Option(name = "install-flag", description = "optional flag(s) to provide when installing apks.")
private List<String> mPostInstallCmds @Option(name = "post-install-cmd", description = "optional post-install adb shell commands; can be repeated.")
private boolean mReboot @Option(name = "reboot", description = "reboot device after running tests.")
private Set<String> mSkipUninstallPkgs @Option(name = "skip-uninstall-pkg", description = "force retention of this package when --uninstall-all is set.")
private boolean mUninstall @Option(name = "uninstall", description = "uninstall only apks in build after test completes.")
private boolean mUninstallAll @Option(name = "uninstall-all", description = "uninstall all unnstallable apks found on device after test completes.")
Public Constructors
AppSetup()
Public Methods
void setUp(ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing.
void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
Perform the target cleanup/teardown after testing.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.targetprep.ITargetPreparer
From interface com.android.tradefed.targetprep.ITargetCleaner

Fields

private boolean mInstall

private ArrayList<String> mInstallFlags

private List<String> mPostInstallCmds

private boolean mReboot

private Set<String> mSkipUninstallPkgs

private boolean mUninstall

private boolean mUninstallAll

Public Constructors

public AppSetup ()

Public Methods

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.

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

Perform the target cleanup/teardown after testing.

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