Search code examples
android-cts

android-gts Setup android-gts on ubuntu16.04


I try to setup andorid-gts on ubuntu16.04. python version is 2.7.16. I have installed below packages:

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

But when I try to run gts command from console, I always get below error:

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 > 

I guess it maybe caused by the timeout logs:

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

Solution

  • This error is caused by old adb version. just use adb version from android sdk should work. if you use sudo apt-get install adb, this timeout error will happen.