2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
InstallApkSetup
public
class
InstallApkSetup
extends BaseTargetPreparer
ファイル システムにある 1 つ以上の APK をインストールする ITargetPreparer
。
このクラスは、すべてのバージョンのテストでファイル システム上の APK に依存している場合にのみ、ファイル システムから APK をインストールするために使用してください。TestAppInstallSetup
を使用してテスト ZIP ファイルから APK をインストールするテストの場合は、--alt-dir
を使用して、他のテスト構成(テスト ZIP ファイルが存在しないローカル実行など)の APK を含むファイルシステム上の代替ディレクトリを指定します。
概要
パブリック コンストラクタ
InstallApkSetup
public InstallApkSetup ()
パブリック メソッド
setApkPaths
public void setApkPaths ( paths)
APK パスを設定します。テスト用に公開されています。
setThrowIfInstallFail
public void setThrowIfInstallFail (boolean throwIfInstallFail)
インストールに失敗した場合はスローを設定します。テスト用に公開されています。
パラメータ |
throwIfInstallFail |
boolean |
setUp
public void setUp (ITestDevice device,
IBuildInfo buildInfo)
パラメータ |
device |
ITestDevice |
buildInfo |
IBuildInfo |
保護されたメソッド
getApkPaths
protected getApkPaths ()
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 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 |"]]