InstallApkSetup

public class InstallApkSetup
extends BaseTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.InstallApkSetup


A ITargetPreparer that installs one or more apks located on the filesystem.

This class should only be used for installing apks from the filesystem when all versions of the test rely on the apk being on the filesystem. For tests which use TestAppInstallSetup to install apks from the tests zip file, use --alt-dir to specify an alternate directory on the filesystem containing the apk for other test configurations (for example, local runs where the tests zip file is not present).

Summary

Public constructors

InstallApkSetup()

Public methods

void setApkPaths(Collection<File> paths)

Sets APK paths.

void setThrowIfInstallFail(boolean throwIfInstallFail)

Set throw if install fail.

void setUp(ITestDevice device, IBuildInfo buildInfo)

Protected methods

Collection<File> getApkPaths()

Public constructors

InstallApkSetup

public InstallApkSetup ()

Public methods

setApkPaths

public void setApkPaths (Collection<File> paths)

Sets APK paths. Exposed for testing.

Parameters
paths Collection

setThrowIfInstallFail

public void setThrowIfInstallFail (boolean throwIfInstallFail)

Set throw if install fail. Exposed for testing.

Parameters
throwIfInstallFail boolean

setUp

public void setUp (ITestDevice device, 
                IBuildInfo buildInfo)

Parameters
device ITestDevice

buildInfo IBuildInfo

Throws
TargetSetupError
BuildError
DeviceNotAvailableException

Protected methods

getApkPaths

protected Collection<File> getApkPaths ()

Returns
Collection<File>