You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询:基于USB ID指定设备运行CTS测试及多设备序列号重复问题

Using USB Identifiers to Target Devices for CTS Tests

Got it, dealing with duplicate serial numbers is such a headache—but leveraging the USB path from adb devices -l is exactly the right fix here. Here's how to use it to run CTS tests on specific devices:

1. Grab the USB Path for Your Target Device

First, run the command you already know to pull up all devices with their USB details:

adb devices -l

You’ll get output like this (matching your example):

$ adb devices -l
List of devices attached
0123456789ABCDEF device usb:2-1.8
0123456789ABCDEF device usb:2-1.7

Jot down the usb:<path> value for the device you want to test (e.g., usb:2-1.8).

2. Target the Device with ADB & CTS

ADB supports using the USB path directly with the -s flag, which you can tie into your CTS workflow in two main ways:

Option 1: Set the Device as ADB’s Global Target

If you want all subsequent commands to focus on this device, run a quick test command to confirm targeting works:

adb -s usb:2-1.8 shell getprop ro.product.model

This will return the device’s model name—perfect for verifying you’ve picked the right one. Once confirmed, you can run your standard CTS commands, and they’ll automatically use this targeted device.

Option 2: Pass the USB Path Directly to CTS Tools

Most CTS utilities (like cts-tradefed) accept a --serial flag that works with the USB path instead of a serial number. For example:

cts-tradefed run commandAndExit cts --serial usb:2-1.8 -m CtsCameraTestCases -t android.hardware.camera2.cts.CameraCharacteristicsTest

This runs a specific CTS test module/case directly on the device with the usb:2-1.8 identifier.

3. Double-Check Before Full Test Runs

Before launching a long CTS suite, always validate your target again with a simple command—this saves you from wasting time testing the wrong device:

adb -s usb:2-1.8 shell echo "Testing this device"

If you see the echo output, you’re good to go.

内容的提问来源于stack exchange,提问作者dvir

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:42:00