از 27 مارس 2025، توصیه می کنیم از android-latest-release به جای aosp-main برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این صفحه حاوی دستورالعملهایی برای اجرای آزمایشهای خودکار CTS در Android 10 یا پایینتر است.
یک جلسه امتحان مجدد را اجرا کنید
اگر این اولین اجرای آزمایشی شماست، ممکن است تست هایی وجود داشته باشد که به دلیل مسائلی که خارج از کنترل شما هستند، با شکست مواجه شوند. برای مثال، اتصال شبکه ممکن است کند باشد یا سیگنال GPS ضعیف باشد. بنابراین، تا زمانی که همه ماژولهای تست کامل شوند و اعداد شکست آزمون در دو جلسه امتحان مجدد یکسان باشند، تستها را دوباره اجرا کنید (دوباره امتحان کنید). برای اجرای یک جلسه امتحان مجدد برای Android 9 و 10:
run retry --retry session_number`
برای اجرای یک جلسه امتحان مجدد برای Android 8.1 یا پایین تر:
run cts --retry session_number
یک جلسه امتحان مجدد روی تست های پارامتری ناموفق اجرا کنید
آزمونهای پارامتری گذرانده شده دوباره امتحان نمیشوند. برای اجرای یک جلسه امتحان مجدد فقط در تست های پارامتری ناموفق:
run retry --retry session_number --new-parameterized-handling
برنامه های تست فردی را اجرا کنید
به جای اجرای همه برنامه های آزمایشی به طور همزمان، می توانید برنامه های آزمایشی فردی را اجرا کنید. برای اجرای طرح آزمایشی فردی:
نام طرح آزمایشی را که می خواهید اجرا کنید مشخص کنید.
برای اندروید 7 و بالاتر:
list modules
برای اندروید 6 یا پایین تر:
list plans
طرح تست را اجرا کنید:
run cts --plan test_module_or_plan_name
بهبود زمان اجرای آزمون
اگر میخواهید زمان اجرای آزمایش را بهبود ببخشید، میتوانید آزمایشها را در چندین دستگاه تقسیم کنید. Sharding به میزبان نیاز دارد که حداقل دو دستگاه را متصل کند، اما شش دستگاه یا بیشتر برای کارایی توصیه می شود.
برای اشتراکگذاری تستها در Android 9 یا 10، اجرا کنید:
run cts --shard-count number_of_shards
برای اشتراکگذاری تستها در اندروید ۸.۱ یا پایینتر، اجرا کنید:
run cts --shards number_of_shards
CTS را برای دستگاه های چند صفحه ای اجرا کنید
اگر دستگاه شما دارای Android 10 است و دستگاه شما دارای چندین صفحه است، باید برنامه آزمایشی cts-foldable را جداگانه اجرا کنید:
run cts-foldable
موارد تست رد شده یا ناموفق برای حالت صفحه نمایش جایگزین با مقدار display_mode اضافه می شود، به عنوان مثال، testcase1[display_mode=0] .
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و 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,["# Run CTS automated tests (AOSP 10 or lower)\n\nThis page contains instructions for running CTS automated tests on Android 10\nor lower.\n\nRun a retry session\n-------------------\n\nIf this is your first test run, there might be tests that fail due to issues\nbeyond your control. For example, a network connection might be slow or a GPS\nsignal might be weak. So, rerun (retry) the tests until all test modules are\ncompleted and the test failure numbers are the same in the last two retry\nsessions. To run a retry session for Android 9 and 10: \n\n run retry --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e`\n\nTo run a retry session for Android 8.1 or lower: \n\n run cts --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e\n\n| **Note:** For implementation details for CTS retry, see [Use suite retry](/docs/core/tests/tradefed/testing/through-suite/suite-retry).\n\nRun a retry session on failed parameterized tests\n-------------------------------------------------\n\nPassed parameterized tests aren't retried. To run a retry session on failed\nparameterized tests only: \n\n run retry --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e --new-parameterized-handling\n\nRun individual test plans\n-------------------------\n\nInstead of running all test plans at once, you can run individual test plans.\nTo run an individual test plan:\n\n1. Identify the name of the test plan you want to run.\n\n For Android 7 and higher: \n\n list modules\n\n For Android 6 or lower: \n\n list plans\n\n2. Run the test plan:\n\n run cts --plan \u003cvar translate=\"no\"\u003etest_module_or_plan_name\u003c/var\u003e\n\n| **Note:** For a list of all CTS console commands for Android 7 and higher, see [CTS v2 command console](/compatibility/cts/command-console-v2). For a list of all CTS console commands for Android 6 or lower, see [CTS v1 command console](/compatibility/cts/command_console).\n\nImprove test execution time\n---------------------------\n\nIf you want to improve test execution time, you can shard tests across multiple\ndevices. Sharding requires the host to connect at least two devices, but six or\nmore devices are recommended for efficiency.\n\nTo shard tests on Android 9 or 10, run: \n\n run cts --shard-count \u003cvar translate=\"no\"\u003enumber_of_shards\u003c/var\u003e\n\nTo shard tests on Android 8.1 or lower, run: \n\n run cts --shards \u003cvar translate=\"no\"\u003enumber_of_shards\u003c/var\u003e\n\nRun CTS for multiscreen devices\n-------------------------------\n\nIf your device is running Android 10, and your device has multiple\nscreens, you must run the `cts-foldable` test plan separately: \n\n run cts-foldable\n\nPassed or failed test cases for alternate screen mode are appended with the\nvalue from `display_mode`, for example, `testcase1[display_mode=0]`."]]