از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نصب ApkSetup
public class InstallApkSetup
extends BaseTargetPreparer
یک ITargetPreparer
که یک یا چند apk را روی سیستم فایل نصب میکند.
این کلاس فقط باید برای نصب apk از سیستم فایل استفاده شود که همه نسخههای آزمایش به apk بودن روی سیستم فایل متکی باشند. برای آزمایشهایی که از TestAppInstallSetup
برای نصب apk از فایل فشرده آزمایشی استفاده میکنند، از --alt-dir
استفاده کنید تا یک فهرست جایگزین در سیستم فایل حاوی apk برای سایر تنظیمات آزمایشی مشخص کنید (به عنوان مثال، اجراهای محلی که در آن فایل فشرده آزمایشی موجود نیست) .
خلاصه
سازندگان عمومی
نصب ApkSetup
public InstallApkSetup ()
روش های عمومی
setApkPaths
public void setApkPaths ( paths)
مسیرهای APK را تنظیم می کند. در معرض آزمایش قرار گرفته است.
setThrowIfInstallFail
public void setThrowIfInstallFail (boolean throwIfInstallFail)
در صورت عدم موفقیت نصب، پرتاب را تنظیم کنید. در معرض آزمایش قرار گرفته است.
پارامترها |
---|
throwIfInstallFail | boolean |
راه اندازی
public void setUp (ITestDevice device,
IBuildInfo buildInfo)
پارامترها |
---|
device | ITestDevice |
buildInfo | IBuildInfo |
روش های محافظت شده
getApkPaths
protected getApkPaths ()
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],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 |"]]