हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
Android प्लैटफ़ॉर्म की जांच
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Android Open Source Project (AOSP), लागू करने के अलग-अलग हिस्सों की जांच करने के लिए कई टूल और टेस्ट सुइट उपलब्ध कराता है. इस सेक्शन में मौजूद पेजों का इस्तेमाल करने से पहले, आपको इन शब्दों के बारे में जानकारी होनी चाहिए:
- Android के साथ काम करने वाला डिवाइस
- ऐसा डिवाइस जो Android SDK और NDK का इस्तेमाल करके, तीसरे पक्ष के डेवलपर के लिखे गए किसी भी तीसरे पक्ष के ऐप्लिकेशन को चला सकता है. Android के साथ काम करने वाले डिवाइसों को कंपैटबिलिटी डेफ़िनिशन डॉक्यूमेंट (सीडीडी) की ज़रूरी शर्तों का पालन करना होगा. साथ ही, उन्हें कंपैटबिलिटी टेस्ट सुइट (CTS) पास करना होगा. Android के साथ काम करने वाले डिवाइस, Android नेटवर्क में शामिल हो सकते हैं. इसमें, Google Play का लाइसेंस, ऐप्लिकेशन और एपीआई के Google Mobile Services (GMS) सुइट का लाइसेंस, और Android ट्रेडमार्क का इस्तेमाल शामिल है. Android सोर्स कोड का इस्तेमाल कोई भी कर सकता है. हालांकि, किसी डिवाइस को Android के साथ काम करने वाला माना जा सकता है, इसके लिए ज़रूरी है कि वह Android के साथ काम करता हो.
- आर्टफ़ैक्ट
- बिल्ड से जुड़ा लॉग, जो स्थानीय समस्या हल करने की सुविधा देता है.
- कंपैटबिलिटी डेफ़िनिशन डॉक्यूमेंट (सीडीडी)
- ऐसा दस्तावेज़ जिसमें Android डिवाइस के लिए, सॉफ़्टवेयर और हार्डवेयर से जुड़ी ज़रूरी शर्तों के बारे में जानकारी दी गई हो.
- Compatibility Test Suite (CTS)
मुफ़्त में उपलब्ध, व्यावसायिक ग्रेड का टेस्ट सुइट. इसे AOSP में बाइनरी या सोर्स के तौर पर डाउनलोड किया जा सकता है. सीटीएस, यूनिट टेस्ट का एक सेट है. इसे आपके रोज़ के वर्कफ़्लो में इंटिग्रेट करने के लिए डिज़ाइन किया गया है. CTS का मकसद, काम न करने वाली सुविधाओं का पता लगाना है. साथ ही, यह पक्का करना है कि डेवलपमेंट की पूरी प्रोसेस के दौरान सॉफ़्टवेयर काम करता रहे.
सीटीएस और प्लैटफ़ॉर्म टेस्ट, एक-दूसरे से अलग नहीं हैं. यहां कुछ सामान्य दिशा-निर्देश दिए गए हैं:
- अगर कोई टेस्ट, फ़्रेमवर्क एपीआई फ़ंक्शन या व्यवहार के सही होने का दावा कर रहा है और इस टेस्ट को सभी OEM पार्टनर पर लागू किया जाना चाहिए, तो यह टेस्ट सीटीएस में होना चाहिए.
- अगर किसी टेस्ट का मकसद प्लैटफ़ॉर्म के डेवलपमेंट के दौरान, रिग्रेशन को पकड़ना है और उसे करने के लिए खास अनुमति की ज़रूरत पड़ सकती है और वह लागू करने की जानकारी (जैसा कि AOSP में रिलीज़ किया गया है) पर निर्भर हो सकता है, तो उसे प्लैटफ़ॉर्म टेस्ट माना जाना चाहिए.
- Google मोबाइल सेवाएं (GMS)
Google के उन ऐप्लिकेशन और एपीआई का कलेक्शन जिन्हें डिवाइसों पर पहले से इंस्टॉल किया जा सकता है.
- GoogleTest (GTest)
C++ टेस्टिंग और मॉकिंग फ़्रेमवर्क. आम तौर पर, GTest बाइनरी, कम लेवल की एब्स्ट्रैक्शन लेयर को ऐक्सेस करती हैं या अलग-अलग सिस्टम सेवाओं के लिए रॉ आईपीसी करती हैं. आम तौर पर, GTest के लिए टेस्टिंग का तरीका, जांच की जा रही सेवा के साथ पूरी तरह से जुड़ा होता है. CTS में GTest फ़्रेमवर्क शामिल होता है.
- इंस्ट्रुमेंटेशन टेस्ट
am instrument
कमांड से लॉन्च किया गया, टेस्ट को चलाने के लिए खास एनवायरमेंट. इसमें टारगेट की गई ऐप्लिकेशन प्रोसेस को रीस्टार्ट किया जाता है और ऐप्लिकेशन के बुनियादी कॉन्टेक्स्ट के साथ शुरू किया जाता है. साथ ही, ऐप्लिकेशन प्रोसेस की वर्चुअल मशीन में इंस्ट्रूमेंटेशन थ्रेड शुरू किया जाता है. सीटीएस में इंस्ट्रूमेंटेशन टेस्ट शामिल होते हैं.
- Logcat
यह एक कमांड-लाइन टूल है, जो सिस्टम मैसेज का लॉग बनाता है. इसमें, डिवाइस में गड़बड़ी होने पर स्टैक ट्रेस और Log
क्लास की मदद से, ऐप्लिकेशन से लिखे गए मैसेज शामिल होते हैं.
- लॉगिंग
कंप्यूटर सिस्टम के इवेंट, जैसे कि गड़बड़ियों को ट्रैक करने के लिए लॉग का इस्तेमाल करना. Android में लॉगिंग करना मुश्किल है, क्योंकि Logcat टूल में कई स्टैंडर्ड का इस्तेमाल किया जाता है.
- postsubmit test
Android टेस्ट, जो किसी सामान्य कर्नेल शाखा में नया पैच कमिट किए जाने पर किया जाता है. शाखा के नाम के कुछ हिस्से के तौर पर aosp_kernel
डालकर, आपको उपलब्ध नतीजों के साथ कर्नेल शाखाओं की सूची दिख सकती है. उदाहरण के लिए, android-mainline
के लिए नतीजे, https://ci.android.com/builds/branches/aosp_kernel-common-android-mainline/grid पर देखे जा सकते हैं.
- प्रोसेस सबमिट करने से पहले की जाने वाली जांच
यह एक टेस्ट है, जिसका इस्तेमाल आम कर्नेल में गड़बड़ियों को रोकने के लिए किया जाता है.
- Trade Federation
इसे Tradefed भी कहा जाता है. यह Android डिवाइसों पर टेस्ट चलाने के लिए डिज़ाइन किया गया, लगातार टेस्ट करने वाला फ़्रेमवर्क है. उदाहरण के लिए,
Tradefed का इस्तेमाल, Compatibility Test Suite और Vendor Test Suite टेस्ट चलाने के लिए किया जाता है.
- Vendor Test Suite (VTS)
Android टेस्टिंग के लिए कई सुविधाओं का सेट, टेस्ट-ड्रिवन डेवलपमेंट प्रोसेस को बढ़ावा देना, और हार्डवेयर एब्स्ट्रैक्शन लेयर (एचएएल) और ओएस कर्नेल की जांच को ऑटोमेट करना.
प्लैटफ़ॉर्म टेस्ट के टाइप
आम तौर पर, प्लैटफ़ॉर्म टेस्ट एक या एक से ज़्यादा Android सिस्टम सेवाओं या एचएएल लेयर के साथ इंटरैक्ट करता है. साथ ही, टेस्ट किए जा रहे विषय की सुविधाओं को इस्तेमाल करता है और टेस्ट के नतीजे के सही होने की पुष्टि करता है. प्लैटफ़ॉर्म टेस्ट में ये काम किए जा सकते हैं:
- (पहला टाइप) Android फ़्रेमवर्क का इस्तेमाल करने वाले कसरत फ़्रेमवर्क एपीआई. इस्तेमाल किए जा रहे खास एपीआई में ये शामिल हो सकते हैं:
- तीसरे पक्ष के ऐप्लिकेशन के लिए बनाए गए सार्वजनिक एपीआई
- छिपे हुए एपीआई, जो खास ऐप्लिकेशन के लिए हैं. जैसे, सिस्टम एपीआई या
निजी एपीआई (
@hide
या protected
, package private
)
- (टाइप 2) रॉ बाइंडर या आईपीसी प्रॉक्सी का इस्तेमाल करके, Android सिस्टम की सेवाओं को सीधे तौर पर शुरू करें.
- (तीसरा टाइप) लो-लेवल एपीआई या आईपीसी इंटरफ़ेस का इस्तेमाल करके, सीधे एचएएल के साथ इंटरैक्ट करें.
टाइप 1 और 2 टेस्ट आम तौर पर इंस्ट्रूमेंटेशन टेस्ट होते हैं, जबकि टाइप 3 टेस्ट आम तौर पर GTests होते हैं.
आगे क्या करना है?
ज़्यादा जानकारी के लिए, यहां दिए गए दस्तावेज़ पढ़ें:
अगर आपने Android के आर्किटेक्चर के बारे में नहीं पढ़ा है, तो आर्किटेक्चर की खास जानकारी देखें.
अगर आपको Android के साथ काम करने वाला कोई डिवाइस बनाना है, तो Android Compatibility Program की खास जानकारी देखें.
इंस्ट्रूमेंटेशन, फ़ंक्शनल, मेट्रिक, और JAR होस्ट टेस्ट को प्लैटफ़ॉर्म की लगातार टेस्टिंग सेवा में इंटिग्रेट करने के लिए, टेस्ट डेवलपमेंट वर्कफ़्लो देखें.
अपने डिवाइसों में मौजूद जोखिम का पता लगाने और उन्हें सुरक्षित बनाने के लिए, सुरक्षा जांच देखें.
एचएएल और कर्नेल को लागू करने की जांच करने के बारे में जानने के लिए, वेंडर टेस्ट सुइट (VTS) और इन्फ़्रास्ट्रक्चर देखें.
ऐप्लिकेशन की जांच करने के लिए, Android ऐप्लिकेशन की जांच करने के बुनियादी सिद्धांत पढ़ें. साथ ही, दिए गए सैंपल का इस्तेमाल करके, Kotlin में Android 05.1:टेस्टिंग के बुनियादी सिद्धांत को पूरा करें.
रेपो हुक की मदद से, सबमिट करने से पहले की जाने वाली बुनियादी टेस्टिंग के बारे में जानें.
इन हुक का इस्तेमाल, आगे बढ़ने से पहले, यूनिट जांच को ट्रिगर करने, फ़ॉर्मैटिंग की जांच करने, और लिंटर चलाने के लिए किया जा सकता है. जैसे, कोई कमिट अपलोड करना. ये हुक डिफ़ॉल्ट रूप से बंद होते हैं. ज़्यादा जानकारी के लिए, AOSP Preupload
Hooks देखें.
लॉगिंग के बारे में ज़्यादा जानने के लिए, लॉगिंग के बारे में जानकारी लेख पढ़ें.
Android कोड को डीबग करने का तरीका जानने के लिए, नेटिव Android प्लैटफ़ॉर्म कोड को डीबग करना लेख पढ़ें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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,["# Android platform testing\n\nAndroid Open Source Project (AOSP) provides several tools and test suites\nfor testing various parts of your implementation. Before using the pages in this\nsection, you should be familiar with the following terms:\n\n*Android-compatible device*\n: A device that can run any third-party app written by third-party developers\n using the Android SDK and NDK. Android-compatible devices must adhere to the\n requirements of the\n [Compatibility Definition Document (CDD)](#CDD) and pass the\n [Compatibility Test Suite (CTS)](#cts). Android-compatible\n devices are eligible to participate in the Android ecosystem, which includes\n potential licensure of Google Play, potential licensure of the\n [Google Mobile Services (GMS)](#gms) suite of\n app and APIs, and use of the Android trademark. Anyone is welcome to\n use the Android source code, but to be considered part of the Android ecosystem,\n a device must be Android compatible.\n\n*artifact*\n: A build-related log that enables local troubleshooting.\n\n*Compatibility Definition Document (CDD)*\n: A document that enumerates the software and hardware requirements for an\n Android-compatible device.\n\n*Compatibility Test Suite (CTS)*\n\n: A free, commercial-grade test suite, available for download as a binary or as\n source in AOSP. The CTS is a set of unit tests designed to be integrated into\n your daily workflow. The intent of CTS is to reveal incompatibilities, and\n ensure that the software remains compatible throughout the development process.\n\n CTS and platform tests aren't mutually exclusive. Here are some general\n guidelines:\n\n - If a test is asserting correctness of framework API functions or behaviors, and the test should be enforced across OEM partners, it should be in CTS.\n - If a test is intended to catch regressions during platform development, and might require privileged permission to carry out, and might be dependent on implementation details (as released in AOSP), it should be a platform test.\n\n*Google Mobile Services (GMS)*\n\n: A collection of Google apps and APIs that can be preinstalled on devices.\n\n*GoogleTest (GTest)*\n\n: A C++ testing and mocking framework. GTest binaries typically\n access lower-level abstraction layers or perform raw IPC against various system\n services. The testing approach for GTest is usually tightly coupled with the\n service being tested. CTS contains the GTest framework.\n\n*instrumentation test*\n\n: A special test execution environment\n launched by the `am instrument` command, where the targeted app process\n is restarted and initialized with basic app context, and an\n instrumentation thread is started inside the app process virtual\n machine. CTS contains instrumentation tests.\n\n*Logcat*\n\n: A command-line tool that creates a log of system messages, including\n stack traces of when the device throws an error and messages that you have\n written from your app with the `Log` class.\n\n*logging*\n\n: Using a log to keep track of computer system events, such\n as errors. Logging in Android is complex due to the mix of standards used that\n are combined in the Logcat tool.\n\n*postsubmit test*\n\n: An Android test that is performed when a new patch is committed to a\n common kernel branch. By entering `aosp_kernel` as a partial branch name, you\n can see a list of kernel branches with results available. For example, results\n for `android-mainline` can be found at\n \u003chttps://ci.android.com/builds/branches/aosp_kernel-common-android-mainline/grid\u003e.\n\n*presubmit test*\n\n: A test used to prevent failures from being introduced into the\n common kernels.\n\n*Trade Federation*\n\n: Also called Tradefed, a continuous test\n framework designed for running tests on Android devices. For example,\n Tradefed is used to run Compatibility Test Suite and Vendor Test Suite tests.\n\n*Vendor Test Suite (VTS)*\n\n: A set of extensive capabilities for\n Android testing, promoting a test-driven development process, and automating\n hardware abstraction layer (HAL) and OS kernel testing.\n\nPlatform test types\n-------------------\n\nA platform test typically interacts with one or more of the Android system\nservices or HAL layers, exercises the\nfunctionalities of the subject under test, and asserts correctness of the\ntesting outcome. A platform test might:\n\n- (Type 1) Exercise framework APIs using Android framework. Specific APIs being exercised can include:\n - Public APIs intended for third-party apps\n - Hidden APIs intended for privileged apps, namely system APIs or private APIs (`@hide`, or `protected`, `package private`)\n- (Type 2) Invoke Android system services using raw binder or IPC proxies directly.\n- (Type 3) Interact directly with HALs using low-level APIs or IPC interfaces.\n\nType 1 and 2 tests are typically instrumentation tests, while type 3 tests are\nusually GTests.\n\nWhat's next?\n------------\n\nHere is a list of documents that you can read for more detailed information:\n\n- If you haven't studied Android architecture, see\n [Architecture overview](/docs/core/architecture).\n\n- If you're creating an Android-compatible device, see\n the [Android compatibility program overview](/docs/compatibility/overview).\n\n- To integrate instrumentation, functional, metric, and JAR host tests\n into a platform continuous testing service, see\n [Test development workflow](/docs/core/tests/development).\n\n- To detect and harden your devices against vulnerabilities,\n see [Security testing](/docs/security/test/fuzz-sanitize).\n\n- To learn about testing your HAL and kernel implementations, see\n [Vendor Test Suite (VTS) and infrastructure](/docs/core/tests/vts).\n\n- For app testing, read\n [Fundamentals of testing Android\n apps](https://developer.android.com/training/testing/fundamentals)\n and conduct the [Advanced Android in Kotlin 05.1:Testing\n Basics](https://codelabs.developers.google.com/codelabs/advanced-android-kotlin-training-testing-basics/index.html)\n using the\n [samples](https://github.com/android/testing-samples) provided.\n\n- Learn about the basic presubmit testing available to you through repo hooks.\n These hooks can be used to run linters, check formatting, and trigger unit\n tests before proceeding, such as uploading a commit. These hooks are disabled\n by default. For further information, see [AOSP Preupload\n Hooks](https://android.googlesource.com/platform/tools/repohooks/+/refs/heads/android16-release/README.md).\n\n- To read more about logging, see [Understand logging](/docs/core/tests/debug/understanding-logging).\n\n- To understand how to debug Android code, see\n [Debug native Android platform code](/docs/core/tests/debug)."]]