InstallApkSetup

public class InstallApkSetup
extends Object implements ITargetPreparer

java.lang.Object
   ↳ 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)

Perform the target setup for testing.

Protected methods

Collection<File> getApkPaths()

Public constructors

InstallApkSetup

InstallApkSetup ()

Public methods

setApkPaths

void setApkPaths (Collection<File> paths)

Sets APK paths. Exposed for testing.

Parameters
paths Collection

setThrowIfInstallFail

void setThrowIfInstallFail (boolean throwIfInstallFail)

Set throw if install fail. Exposed for testing.

Parameters
throwIfInstallFail boolean

setUp

void setUp (ITestDevice device, 
                IBuildInfo buildInfo)

Perform the target setup for testing.

Parameters
device ITestDevice: the ITestDevice to prepare.

buildInfo IBuildInfo: data about the build under test.

Throws
TargetSetupError
BuildError
DeviceNotAvailableException

Protected methods

getApkPaths

Collection<File> getApkPaths ()

Returns
Collection<File>