A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
InstalarApkSetup
public class InstallApkSetup
extends BaseTargetPreparer
Un ITargetPreparer
que instala una o más aplicaciones ubicadas en el sistema de archivos.
Esta clase solo debe usarse para instalar apk desde el sistema de archivos cuando todas las versiones de la prueba dependen de que el apk esté en el sistema de archivos. Para las pruebas que usan TestAppInstallSetup
para instalar apks desde el archivo zip de pruebas, use --alt-dir
para especificar un directorio alternativo en el sistema de archivos que contiene el apk para otras configuraciones de prueba (por ejemplo, ejecuciones locales donde el archivo zip de pruebas no está presente) .
Resumen
Constructores públicos
InstalarApkSetup
public InstallApkSetup ()
Métodos públicos
establecerApkPaths
public void setApkPaths ( paths)
Establece rutas de APK. Expuesto para pruebas.
setThrowIfInstallFail
public void setThrowIfInstallFail (boolean throwIfInstallFail)
Establezca throw si falla la instalación. Expuesto para pruebas.
Parámetros |
---|
throwIfInstallFail | boolean |
configuración
public void setUp (ITestDevice device,
IBuildInfo buildInfo)
Parámetros |
---|
device | ITestDevice |
buildInfo | IBuildInfo |
Métodos protegidos
obtenerApkPaths
protected getApkPaths ()
El contenido y el código de ejemplo de esta página están sujetos a las licencias que se describen en la licencia de contenido. Java y OpenJDK son marcas registradas de Oracle o sus entidades asociadas.
Última actualización: 2023-12-01 (UTC).
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Me falta la información que necesito","missingTheInformationINeed","thumb-down"],["Es demasiado complicado o hay demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Está obsoleto","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema de muestras o código","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2023-12-01 (UTC)."],[],[],null,["# InstallApkSetup\n===============\n\n\n`\npublic\n\n\nclass\nInstallApkSetup\n`\n\n\n`\n\n\n`\n\n`\n\nextends `[BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|-------------------------------------------------|\n| java.lang.Object |||\n| ↳ | [com.android.tradefed.targetprep.BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html) ||\n| | ↳ | com.android.tradefed.targetprep.InstallApkSetup |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA [ITargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/ITargetPreparer.html) that installs one or more apks located on the filesystem.\n\nThis class should only be used for installing apks from the filesystem when all versions of\nthe test rely on the apk being on the filesystem. For tests which use [TestAppInstallSetup](../../../../../../reference/tradefed/com/android/tradefed/targetprep/TestAppInstallSetup.html)\nto install apks from the tests zip file, use `--alt-dir` to specify an alternate directory\non the filesystem containing the apk for other test configurations (for example, local runs where\nthe tests zip file is not present).\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[InstallApkSetup](../../../../../../reference/tradefed/com/android/tradefed/targetprep/InstallApkSetup.html#InstallApkSetup())`() ` |\n\n| ### Public methods ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[setApkPaths](../../../../../../reference/tradefed/com/android/tradefed/targetprep/InstallApkSetup.html#setApkPaths(\u003cany\u003e))`(` paths) Sets APK paths. |\n| ` void` | ` `[setThrowIfInstallFail](../../../../../../reference/tradefed/com/android/tradefed/targetprep/InstallApkSetup.html#setThrowIfInstallFail(boolean))`(boolean throwIfInstallFail) ` Set throw if install fail. |\n| ` void` | ` `[setUp](../../../../../../reference/tradefed/com/android/tradefed/targetprep/InstallApkSetup.html#setUp(com.android.tradefed.device.ITestDevice,%20com.android.tradefed.build.IBuildInfo))`(`[ITestDevice](../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` device, `[IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html)` buildInfo) ` |\n\n| ### Protected methods ||\n|-----|--------------------------------------------------------------------------------------------------------------------------------|\n| ` ` | ` `[getApkPaths](../../../../../../reference/tradefed/com/android/tradefed/targetprep/InstallApkSetup.html#getApkPaths())`() ` |\n\nPublic constructors\n-------------------\n\n### InstallApkSetup\n\n```\npublic InstallApkSetup ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### setApkPaths\n\n```\npublic void setApkPaths ( paths)\n```\n\nSets APK paths. Exposed for testing.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------|\n| `paths` | \u003cbr /\u003e |\n\n### setThrowIfInstallFail\n\n```\npublic void setThrowIfInstallFail (boolean throwIfInstallFail)\n```\n\nSet throw if install fail. Exposed for testing.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------------|------------------|\n| `throwIfInstallFail` | `boolean` \u003cbr /\u003e |\n\n### setUp\n\n```\npublic void setUp (ITestDevice device, \n IBuildInfo buildInfo)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|----------------------|\n| `device` | `ITestDevice` \u003cbr /\u003e |\n| `buildInfo` | `IBuildInfo` \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------|---|\n| [BuildError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BuildError.html) | |\n| [DeviceNotAvailableException](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |\n| [TargetSetupError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/TargetSetupError.html) | |\n\nProtected methods\n-----------------\n\n### getApkPaths\n\n```\nprotected getApkPaths ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|--------|\n| | \u003cbr /\u003e |"]]