To run multidevice NFC tests, prepare two devices with Android 15.
Prepare two devices under test (DUTs) for the test:
- Connect the DUTs to a host machine over USB.
- Grant permissions for the host to access the DUTs over adb.
Install the CTS Verifier app (
CtsVerifier.apk
) on the devices.:extract root/out/host/linux-x86/cts-verifier/android-cts-verifier.zip cd android-cts-verifier adb install -r -g CtsVerifier.apk
Install the required NFC test APKs:
cd MultiDevice adb install -r -g NfcReaderTestApp.apk adb install -r -g NfcEmulatorTestApp.apk
Set up NFC for the two DUTs:
- On both devices, go to Settings.
- Click NFC or Connected Devices.
- Ensure the NFC toggle switch is turned on.
- Hold the two devices close together, so that their NFC antennas are touching. The location of the antennas might be different for each device. You might need to use tape to keep the devices in place against unwanted vibration.
Set up the environment:
Install the Mobly test framework:
pip install mobly
If the command fails, try:
pip install mobly --user --break-system-packages
For more details about Mobly setup, refer to Welcome to Mobly.
Set up the test environment:
cd MultiDevice source build/envsetup.sh
This command checks the Python and Mobly installation and sets up the
PYTHONPATH
environment variable. If no errors are printed to the terminal, the environment is ready to run the multidevice tests.If you see the error message
libtinfo.so.6: no version information available (required by /bin/sh)
at runtime, run the following command to rename thelibtinfo.so.6
file:mv $ENV_DIRECTORY/lib/libtinfo.so.6 $ENV_DIRECTORY/lib/libtinfo.so.6.bak
Set up the test bed by setting the device serial IDs of the DUTs in the
MultiDevice/config.yml
:TestBeds: - Name: cts_nfc_hce_multi_device_test Controllers: AndroidDevice: - serial: "<device-id>" - serial: "<device-id>"
Run the tests:
Open the CTS-V app and click NFC Tests:
Figure 1. The CTS-V app.
The info window with list of test cases appears:
Figure 2. CTS-V app test cases.
Run the tests on your host:
MultiDevice$ python3 tools/run_all_tests.py
When the tests are completed, the test results are updated in the CTS-V app. Successful tests are green:
Figure 3. CTS-V test results.
If you see any failures marked in red, run the tests again.