हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
अपने-आप होने वाली जांचों को चलाना (Android 11 या इसके बाद के वर्शन के लिए)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
सीटीएस के ऑटोमेटेड टेस्ट चलाने के लिए, दो विकल्प हैं:
Trade Federation एक ऐप्लिकेशन और टेस्ट फ़्रेमवर्क है. इसकी मदद से, कमांड लाइन से टेस्ट चलाए जा सकते हैं. बुनियादी तौर पर, फ़्रेमवर्क की मदद से @Test
एनोटेशन का इस्तेमाल करके, टेस्ट में एनोटेशन जोड़े जा सकते हैं. इसके बाद, ऐप्लिकेशन उन टेस्ट को ढूंढता और चलाता है.
OmniLab Android Test Station एक ऐसा ऐप्लिकेशन है जिसकी मदद से, जीयूआई में टेस्ट चलाए जा सकते हैं.
इस पेज पर, Trade Federation का इस्तेमाल करके ऑटोमेटेड टेस्ट चलाने का तरीका बताया गया है. OmniLab Android टेस्ट हार्नेस का इस्तेमाल करके टेस्ट चलाने के निर्देशों के लिए, OmniLab Android टेस्ट स्टेशन देखें.
अपने-आप चलने वाले सभी सीटीएस टेस्ट चलाना
Trade Federation में CTS कंसोल होता है. यह टेस्ट चलाने के लिए कमांड-लाइन इंटरफ़ेस होता है. अपने-आप चलने वाले सीटीएस टेस्ट सुइट को चलाने के लिए:
- पक्का करें कि आपने CTS की ऑटोमेटेड टेस्टिंग सेट अप करना लेख में दिए गए निर्देशों का पालन किया हो.
अपने टेस्ट वर्कस्टेशन पर, उस फ़ोल्डर से cts-tradefed
स्क्रिप्ट चलाकर CTS कंसोल लॉन्च करें जहां CTS पैकेज को अनज़िप किया गया है:
./android-cts/tools/cts-tradefed
सीटीएस कंसोल में कर्सर दिखता है, ताकि आप सीटीएस कमांड (cts-tradefed >
) टाइप कर सकें.
cts
टेस्ट प्लान में, अपने-आप चलने वाले सभी सीटीएस टेस्ट शामिल होते हैं. cts
टेस्ट प्लान चलाने के लिए, यह कमांड चलाएं:
run cts
अपने-आप चलने वाली सीटीएस जांचें शुरू हो जाती हैं. यहां दी गई बातों का ध्यान रखें:
Android 13 और उसके बाद के वर्शन में, एक से ज़्यादा डिवाइसों पर टेस्ट करने की सुविधा काम करती है. ये टेस्ट सिर्फ़ तब अपने-आप चलते हैं, जब sharding का इस्तेमाल किया जाता है. टास्क को अलग-अलग हिस्सों में बांटने के बारे में ज़्यादा जानने के लिए,
टेस्ट को पूरा करने में लगने वाले समय को कम करना लेख पढ़ें. अगर आपको इन टेस्ट को मैन्युअल तरीके से चलाना है, तो मल्टी-डिवाइस टेस्ट चलाना लेख पढ़ें.
CTS चलाते समय, मौजूदा CTS कंसोल को रोकने के लिए ctrl+c दबाएं. इसके बाद, CTS कंसोल को फिर से चलाएं.
एक ही होस्ट पर, सीटीएस के कई वर्शन नहीं चलाए जा सकते. ऐसा इसलिए, क्योंकि हर वर्शन, पहले से मौजूद ओपन लोकेशन कोड (ओएलसी) सर्वर के साथ खुलता है.
टेस्ट के नतीजे देखें. ज़्यादा जानकारी के लिए, सीटीएस के नतीजों को समझना लेख पढ़ें.
अगर यह पहली बार टेस्ट किया जा रहा है, तो हो सकता है कि कुछ टेस्ट आपके कंट्रोल से बाहर की समस्याओं की वजह से फ़ेल हो जाएं. उदाहरण के लिए, हो सकता है कि नेटवर्क कनेक्शन धीमा हो या जीपीएस सिग्नल कमज़ोर हो. टेस्ट को तब तक फिर से चलाएं (फिर से कोशिश करें), जब तक सभी टेस्ट मॉड्यूल पूरे न हो जाएं और टेस्ट में हुई गड़बड़ियों की संख्या, दो बार फिर से कोशिश करने के पिछले दो सेशन में एक जैसी न हो जाए:
run retry --retry session_number`
अगर बार-बार कोशिश करने के बाद भी टेस्ट पूरा नहीं हो पाता है, तो बाकी टेस्ट को डीबग करने पर फ़ोकस करें. जांच के नतीजों से जुड़ी समस्या हल करने के बारे में जानने के लिए, टेस्ट में फ़ेल होने की समस्या हल करना और सीटीएस टेस्ट से जुड़ी समस्या हल करना लेख पढ़ें.
मल्टीस्क्रीन डिवाइसों के लिए सीटीएस चलाना
अगर आपके डिवाइस में Android 11 या 12 वर्शन है और उसमें एक से ज़्यादा स्क्रीन हैं, तो आपको cts-foldable
टेस्ट प्लान को अलग से चलाना होगा:
run cts-foldable
वैकल्पिक स्क्रीन मोड के लिए पास या फ़ेल हुए टेस्ट केस, display_mode
की वैल्यू के साथ जोड़े जाते हैं. उदाहरण के लिए, testcase1[display_mode=0]
.
एक से ज़्यादा डिवाइसों पर टेस्ट चलाना (Android 15 या उससे पहले का वर्शन)
cts-multidevice
टेस्ट प्लान चलाने के लिए, यह कमांड चलाएं:
run cts-multidevice
अलग-अलग टेस्ट प्लान चलाना
सभी टेस्ट प्लान एक साथ चलाने के बजाय, अलग-अलग टेस्ट प्लान चलाए जा सकते हैं.
यह विकल्प, समय बचाने और टेस्ट के किसी खास सेट पर फ़ोकस करने के लिए मददगार है.
किसी एक टेस्ट प्लान को चलाने के लिए:
list modules
कमांड चलाकर, उस टेस्ट प्लान का नाम पता करें जिसे आपको चलाना है.
टेस्ट प्लान चलाने के लिए:
run cts --plan test_module_or_plan_name
टेस्ट को पूरा करने में लगने वाले समय को कम करना
अगर आपको टेस्ट को पूरा करने में लगने वाले समय को कम करना है, तो टेस्ट को कई डिवाइसों पर चलाया जा सकता है. शर्ड करने के लिए, होस्ट को कम से कम दो डिवाइस कनेक्ट करने होंगे. हालांकि, बेहतर परफ़ॉर्मेंस के लिए छह या उससे ज़्यादा डिवाइसों को कनेक्ट करने का सुझाव दिया जाता है.
Android 11 या इसके बाद के वर्शन पर टेस्ट को अलग-अलग हिस्सों में बांटने के लिए, यह तरीका अपनाएं:
run cts --shard-count number_of_shards
इसके अलावा, पुष्टि करने के लिए टेस्ट चलाने से पहले, CTS run cts-dev
कमांड का इस्तेमाल करके, टेस्ट को लागू करने में लगने वाले समय को बेहतर बनाया जा सकता है. यह कमांड, ज़रूरी शर्तों, डिवाइस की जानकारी इकट्ठा करने, और सिस्टम की स्थिति की जांच करने वाली सभी सुविधाओं को स्किप कर देता है.
यह सिर्फ़ एक एबीआई पर टेस्ट चलाता है.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-30 (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-30 (UTC) को अपडेट किया गया."],[],[],null,["# Run automated tests (Android 11 or higher)\n\nThere are two options for running CTS automated tests:\n\n- *Trade Federation* is an app and test framework that lets you\n run tests from the command line. Fundamentally, the framework\n lets you annotate tests using the `@Test` annotation and the app finds and runs\n those tests.\n\n- *OmniLab Android Test Station* is an app that lets you run tests\n in a GUI.\n\nThis page explains how to run automated tests using Trade Federation. For\ninstructions on running tests using OmniLab Android Test Harness, see\n[OmniLab Android Test Station](/docs/core/tests/development/android-test-station/ats-user-guide).\n\nRun all automated CTS tests\n---------------------------\n\nTrade Federation contains the *CTS console*, a command-line interface for\nrunning tests. To run the entire automated CTS test suite:\n\n1. Ensure you have followed the instructions in [Set up CTS automated testing](/docs/compatibility/cts/setup).\n2. On your test workstation, launch the CTS console by running the `cts-tradefed` script from the folder where the CTS package has been unzipped:\n\n ./android-cts/tools/cts-tradefed\n\n The CTS console displays a cursor for you to type CTS commands\n (`cts-tradefed \u003e`).\n3. The `cts` test plan contains all of the automated CTS tests. Execute the\n following command to run the `cts` test plan:\n\n run cts\n\n The automated CTS tests execute. Note the following:\n - Android 13 and higher support multidevice testing. These tests run\n automatically only when sharding is used. For further information on sharding,\n see [Improve test execution time](#improve). If you want to run these tests\n manually, see [Run multidevice tests](#multi-device-testing).\n\n - Whenever running CTS, press **ctrl+c** to stop the existing CTS console\n and then rerun the CTS console.\n\n - You can't run multiple CTS versions on single host because each opens\n with an existing open location code (OLC) server.\n\n4. View test results. For more information, see [Interpret CTS results](/docs/compatibility/cts/interpret).\n\n5. If this is your first test run, there might be tests that fail due to issues beyond your control. For example, a network connection might be slow or a GPS signal might be weak. Rerun (retry) the tests until all test modules are completed and the test failure numbers are the same between the last two retry sessions:\n\n run retry --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 | **Note:** For instructions on how to run a retry session on Android 10 or lower, see [Run CTS automated tests (AOSP 10 or lower)](/docs/compatibility/cts/run-older).\n6. After tests failures are consistent across retries, focus on debugging\n the remaining failed tests. For information on troubleshooting test\n results, see\n [Triage test failures](/docs/compatibility/cts/interpret#triaging-test-failures)\n and\n [Troubleshoot CTS tests](/docs/compatibility/cts/troubleshooting).\n\n| **Note:** For a list of all CTS console commands, see [CTS v2 command console](/compatibility/cts/command-console-v2).\n\nRun CTS for multiscreen devices\n-------------------------------\n\nIf your device is running Android 11 or 12, 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]`.\n| **Note:** For instructions on how to run the `cts-foldable` test plan for Android 10 or lower, see [Run CTS automated tests (Android 10 or lower)](/docs/compatibility/cts/run-older).\n\nRun multidevice tests (Android 15 or lower)\n-------------------------------------------\n\nExecute the following command to run the `cts-multidevice` test plan: \n\n run cts-multidevice\n\nRun individual test plans\n-------------------------\n\nInstead of running all test plans at once, you can run individual test plans.\nThis option is useful to save time and to focus on a specific set of tests.\nTo run an individual test plan:\n\n1. Identify the name of the test plan you want to run by executing the `list modules` command.\n\n | **Note:** For instructions on how to identify the module on Android 10 or lower, see [Run CTS automated tests (Android 10 or lower)](/docs/compatibility/cts/run-older).\n2. Run the test plan:\n\n run cts --plan \u003cvar translate=\"no\"\u003etest_module_or_plan_name\u003c/var\u003e\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 11 or higher, run: \n\n run cts --shard-count \u003cvar translate=\"no\"\u003enumber_of_shards\u003c/var\u003e\n\nAdditionally, before running your tests for validation you can improve test\nexecution time by using the CTS `run cts-dev` command. This command skips\npreconditions, device-information collection, and all system status checkers.\nIt also runs the tests on only a single ABI."]]