我运行 VTS 测试套件,我的测试 100% 失败并出现以下一致错误:
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1489'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1922'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:4950'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1566'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:7793'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:4126'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:3753'. ret: 1, stdout: , stderr: error: more than one device/emulator
消息是stderr: error: more than one device/emulator
但如果我列出 adb devices
我只会得到一个设备
List of devices attached
10.1.1.5:5555 device
在 VTS 提示中相同:
vts-tf > l d
Serial State Allocation Product Variant Build Battery
10.1.1.5:5555 ONLINE Allocated dev_prod dev_prod 6/22/2018.025 100
我与被测设备的连接不是通过 USB 而是通过以太网。
为什么 adb
看到 不止一个设备/模拟器
因为事实并非如此?
有谁知道端口 5010
的服务以及为什么被重定向(反向
)到随机端口 1489、1922、4950
等?
最佳答案
它似乎无法在通过以太网的 adb
连接上工作,您需要通过 USB 的 adb
连接。
由于构建是在服务器上进行的,因此我发现了这种解决方法,可以按照以下步骤在通过 USB 直接连接到 DUT 的机器上运行 vts:
1) 重启DUT
2) 杀死旧的 adb
并检查 USB 连接
sudo killall -9 adb
adb devices
3) 然后尝试通过 sshfs
安装从服务器上的构建运行 vts:
sudo apt-get install sshfs
mkdir android
sudo groupadd fuse
sudo modprobe fuse
sudo adduser $USER fuse
fusermount -uz ./android
sshfs user@server:/storage/user/android-build/ ./android
cd android
cd ./out/host/linux-x86/vts/android-vts/tools/
pushd `pwd` && cd ./out/host/linux-x86/bin && export PATH=$PATH:$(pwd) && popd
./vts-tradefed
关于android - 为什么 VTS 因不准确的 adb 错误而失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50984960/