首页 > 解决方案 > android-gts 在 ubuntu16.04 上设置 android-gts

问题描述

我尝试在 ubuntu16.04 上设置 andorid-gts。python版本是2.7.16。我已经安装了以下软件包:

pip install future
pip install protobuf
pip install auth
pip install compiler
pip install virtualenv
pip install PyPi
pip install google-cloud-storage
pip install oauth2client

但是当我尝试从控制台运行 gts 命令时,总是出现以下错误:

android Google Mobile Services (GMS) Test Suite 7.0_r3 (6045416)
Use "help" or "help all" to get more information on running commands.
02-06 15:25:34 I/DeviceManager: Detected new device xxxxxxxx
gts-tf > run gts
02-06 15:25:39 I/TestInvocation: Starting invocation for 'gts' with '[ DeviceBuildInfo{bid=6045416, serial=xxxxxxxx} on device 'xxxxxxxx'] 
02-06 15:25:53 W/BusinessLogicPreparer: Option config-filename isn't set. Using empty string instead.
02-06 15:25:53 W/BusinessLogicPreparer: Option version isn't set. Using 'null' instead.
02-06 15:27:54 W/NativeDevice: TimeoutException () when attempting adb content on device xxxxxxxx
02-06 15:30:04 W/NativeDevice: TimeoutException () when attempting adb content on device xxxxxxxx
02-06 15:32:13 W/NativeDevice: TimeoutException () when attempting adb content on device xxxxxxxx
02-06 15:32:21 W/TestInvocation: Invocation did not complete due to device xxxxxxxx becoming not available. Reason: Attempted adb content multiple times on device xxxxxxxx without communication success. Aborting.
02-06 15:33:02 E/RunCommandTargetPreparer: Skipping command teardown since exception was DeviceNotAvailable
02-06 15:33:02 E/RunCommandTargetPreparer: Skipping command teardown since exception was DeviceNotAvailable
02-06 15:33:02 I/SuiteResultReporter: 
============================================
================= Results ==================
=============== Consumed Time ==============
Total aggregated tests run time: 0 ms
=============== Summary ===============
Total Run time: 7m 22s
0/0 modules completed
Total Tests       : 0
PASSED            : 0
FAILED            : 0
============== End of Results ==============
============================================

gts-tf > 

我想这可能是由超时日志引起的:

02-06 15:27:54 W/NativeDevice: TimeoutException () when attempting adb content on device xxxxxxxx

标签: android-cts

解决方案


此错误是由旧的 adb 版本引起的。只需使用来自 android sdk 的 adb 版本就可以了。如果使用sudo apt-get install adb,则会发生此超时错误。


推荐阅读