हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
एक से ज़्यादा डिवाइसों पर एनएफ़सी टेस्ट चलाना (Android 15)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस दस्तावेज़ में, एक से ज़्यादा डिवाइसों पर NFC टेस्ट करने का तरीका बताया गया है.
ज़रूरी शर्तें पूरी करना
एक से ज़्यादा डिवाइसों पर एनएफ़सी टेस्ट करने से पहले, ये काम करें:
- Android 15 को लागू करने के लिए, कोई डिवाइस तैयार करें.
- CTS-V की ज़रूरी शर्तों का पालन करें.
- CTS-V के सेटअप का पालन करें.
जांच के लिए, डीयूटी और PN532 एनएफ़सी रीडर तैयार करना
पिछले चरण पूरे करने के बाद, जांच के लिए डीयूटी और PN532 एनएफ़सी रीडर को तैयार करने के लिए, यह तरीका अपनाएं:
- डीयूटी को यूएसबी के ज़रिए होस्ट मशीन से कनेक्ट करें.
- होस्ट को एडीबी के ज़रिए डीयूटी को ऐक्सेस करने की अनुमतियां दें.
डीयूटी पर CTS Verifier ऐप्लिकेशन (CtsVerifier.apk
) इंस्टॉल करें:
extract root/out/host/linux-x86/cts-verifier/android-cts-verifier.zip
cd android-cts-verifier
adb install -r -g CtsVerifier.apk
एनएफ़सी टेस्ट के लिए ज़रूरी APK इंस्टॉल करें:
cd MultiDevice
adb install -r -g NfcEmulatorTestApp.apk
डीयूटी के लिए एनएफ़सी सेट अप करना
डीयूटी के लिए एनएफ़सी सेट अप करने के लिए, यह तरीका अपनाएं:
- डीयूटी पर, सेटिंग मेन्यू पर जाएं.
- एनएफ़सी या कनेक्ट किए गए डिवाइस सेक्शन ढूंढें.
- पक्का करें कि एनएफ़सी टॉगल स्विच चालू हो.
फ़ोन के एनएफ़सी रीडर पर एनएफ़सी चिप को इस तरह से रखें:
- PN532 एनएफ़सी चिप खरीदें. हमारा सुझाव है कि आप All-In-One PN532 का इस्तेमाल करें. यह बीएलई वाला विकल्प नहीं है.
- यूएसबी केबल का इस्तेमाल करके, PN532 एनएफ़सी चिप को Linux होस्ट से अटैच करें.
- PN532 एनएफ़सी चिप को फ़ोन के एनएफ़सी रीडर के ऊपर रखें, जैसा कि इस इमेज में दिखाया गया है:
पहली इमेज. एनएफ़सी चिप की जगह.
टेस्ट एनवायरमेंट सेट अप करना
टेस्टिंग एनवायरमेंट सेट अप करने के लिए, यह तरीका अपनाएं:
टेस्टिंग एनवायरमेंट सेट अप करने के लिए, ये कमांड चलाएं:
cd MultiDevice
source build/envsetup.sh
यह निर्देश, Python की जांच करता है और PYTHONPATH
एनवायरमेंट वैरिएबल को सेट अप करता है. अगर टर्मिनल पर कोई गड़बड़ी नहीं दिखती है, तो इसका मतलब है कि एनवायरमेंट, कई डिवाइसों पर टेस्ट चलाने के लिए तैयार है.
अगर आपको रनटाइम के दौरान गड़बड़ी का मैसेज libtinfo.so.6: no version information
available (required by /bin/sh)
दिखता है, तो libtinfo.so.6
फ़ाइल का नाम बदलने के लिए यह कमांड चलाएं:
mv $ENV_DIRECTORY/lib/libtinfo.so.6 $ENV_DIRECTORY/lib/libtinfo.so.6.bak
MultiDevice/config.yml
में डीयूटी और PN532 एनएफ़सी रीडर के डिवाइस सीरियल आईडी सेट करके, टेस्ट बेड सेट अप करें:
TestBeds:
- Name: CtsNfcHceMultiDeviceTestCases-py-ctsv
Controllers:
AndroidDevice:
- serial: "<device-id>"
TestParams:
pn532_serial_path: "<pn532-serial-path>"
एनएफ़सी की जांच करना
एनएफ़सी की जांच करने के लिए:
CTS-V ऐप्लिकेशन खोलें और एनएफ़सी टेस्ट पर टैप करें:
दूसरी इमेज. CTS-V ऐप्लिकेशन.
टेस्ट केस की सूची वाली जानकारी वाली विंडो दिखती है:
तीसरी इमेज. CTS-V ऐप्लिकेशन के टेस्ट केस.
अपने होस्ट पर टेस्ट चलाएं:
MultiDevice$ python3 tools/run_all_tests.py
जांच पूरी होने के बाद, जांच के नतीजे CTS-V ऐप्लिकेशन में अपडेट हो जाते हैं. जिन जांचों में कोई समस्या नहीं मिली है उनके नतीजे हरे रंग में दिखते हैं:
चौथी इमेज. CTS-V टेस्ट के नतीजे.
अगर आपको लाल रंग में मार्क की गई कोई गड़बड़ी दिखती है, तो गड़बड़ी वाले टेस्ट को फिर से चलाने के लिए, इस कमांड का इस्तेमाल करें:
python3 tools/run_all_tests.py --test_cases "`TestCaseA`" "`TestCaseB`" --test_files "`TestFileA`"
यहां:
TestCaseA
और TestCaseB
, CTS-V में दिखाए गए टेस्ट केस के नाम हैं.
TestFileA
वह टेस्ट फ़ाइल है जिसमें टेस्ट केस शामिल होते हैं.
उदाहरण के लिए:
python3 tools/run_all_tests.py --test_cases "test_conflicting_non_payment" "test_conflicting_non_payment_prefix" --test_files "CtsNfcHceMultiDeviceTestCases-py-ctsv"
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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,["# Run multi-device NFC tests (Android 15)\n\nThis document explains how to run multi-device NFC tests.\n\nMeet prerequisites\n------------------\n\nBefore you run multi-device NFC tests, do the following:\n\n1. Prepare a device with your Android 15 implementation.\n2. Follow CTS-V [requirements](/docs/compatibility/cts/verifier#requirements).\n3. Follow CTS-V [setup](/docs/compatibility/cts/verifier#setup).\n\nPrepare a DUT and a PN532 NFC reader for the test\n-------------------------------------------------\n\nAfter you finish the previous steps, follow these steps to run\nprepare a DUT and a PN532 NFC reader for the test:\n\n1. Connect the DUT to a host machine over USB.\n2. Grant permissions for the host to access the DUT over ADB.\n3. Install the CTS Verifier app (`CtsVerifier.apk`) on the DUT:\n\n extract root/out/host/linux-x86/cts-verifier/android-cts-verifier.zip\n\n cd android-cts-verifier\n\n adb install -r -g CtsVerifier.apk\n\n4. Install the NFC test required APKs:\n\n cd MultiDevice\n\n adb install -r -g NfcEmulatorTestApp.apk\n\nSet up NFC for the DUT\n----------------------\n\nFollow these steps to run set up NFC for the DUT:\n\n1. On the DUT, go to the **Settings** menu.\n2. Look for the **NFC** or **Connected Devices** section.\n3. Ensure the NFC toggle switch is turned on.\n4. Position an NFC chip on the phone's NFC reader:\n\n 1. Acquire a PN532 NFC chip. We recommend the [All-In-One PN532](https://shop.mtoolstec.com/product/mtools-all-in-one-pn532), non-BLE option.\n 2. Attach the PN532 NFC chip to the Linux host using a USB cable.\n 3. Place the PN532 NFC chip over the phone's NFC reader as shown in the following image:\n\n **Figure 1.** NFC chip placement.\n\nSet up the test environment\n---------------------------\n\nFollow these steps to run set up the test environment:\n\n1. Run these commands to set up the test environment:\n\n cd MultiDevice\n\n source build/envsetup.sh\n\n This command checks the Python and sets up the `PYTHONPATH` environment\n variable. If no errors are printed to the terminal, the environment is ready\n to run the multi-device tests.\n\n If you see the error message `libtinfo.so.6: no version information\n available (required by /bin/sh)` at runtime, run the following command\n to rename the `libtinfo.so.6` file: \n\n mv $ENV_DIRECTORY/lib/libtinfo.so.6 $ENV_DIRECTORY/lib/libtinfo.so.6.bak\n\n2. Set up the test bed by setting the device serial IDs of the DUT and PN532 NFC\n reader in `MultiDevice/config.yml`:\n\n TestBeds:\n - Name: CtsNfcHceMultiDeviceTestCases-py-ctsv\n Controllers:\n AndroidDevice:\n - serial: \"\u003cdevice-id\u003e\"\n TestParams:\n pn532_serial_path: \"\u003cpn532-serial-path\u003e\"\n\nRun the NFC tests\n-----------------\n\nTo run the NFC tests:\n\n1. Open the CTS-V app and tap **NFC Tests**:\n\n **Figure 2.** The CTS-V app.\n\n The info window with list of test cases appears:\n\n **Figure 3.** CTS-V app test cases.\n2. Run the tests on your host:\n\n MultiDevice$ python3 tools/run_all_tests.py\n\n When the tests are completed, the test results are updated in the CTS-V\n app. Successful tests are green:\n\n **Figure 4.** CTS-V test results.\n3. If you see any failures marked in red, use the following command to rerun\n the failed tests:\n\n python3 tools/run_all_tests.py --test_cases \"`\u003cvar translate=\"no\"\u003eTestCaseA\u003c/var\u003e`\" \"`\u003cvar translate=\"no\"\u003eTestCaseB\u003c/var\u003e`\" --test_files \"`\u003cvar translate=\"no\"\u003eTestFileA\u003c/var\u003e`\"\n\n Where:\n - \u003cvar translate=\"no\"\u003eTestCaseA\u003c/var\u003e and \u003cvar translate=\"no\"\u003eTestCaseB\u003c/var\u003e are the names of the test cases as displayed in CTS-V.\n - \u003cvar translate=\"no\"\u003eTestFileA\u003c/var\u003e is the test file containing the test cases.\n\n For example: \n\n python3 tools/run_all_tests.py --test_cases \"test_conflicting_non_payment\" \"test_conflicting_non_payment_prefix\" --test_files \"CtsNfcHceMultiDeviceTestCases-py-ctsv\""]]