Seems like most devices don't have the logpersist service. Atleast not my Nexus 6P with latest Android 7.0.1. Any thoughts on how I can make this work?
$python hello.py -c config.json
[SampleTestBed] 12-11 13:27:46.351 INFO ==========> HelloWorldTest <==========
[SampleTestBed] 12-11 13:27:46.625 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start adb logcat!
Traceback (most recent call last):
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
self.start_adb_logcat()
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
self.adb.shell("logpersist.stop --clear")
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
return self._exec_adb_cmd(clean_name, arg_str)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found
[SampleTestBed] 12-11 13:27:46.626 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start some services, abort!
Traceback (most recent call last):
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
self.start_adb_logcat()
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
self.adb.shell("logpersist.stop --clear")
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
return self._exec_adb_cmd(clean_name, arg_str)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found
[SampleTestBed] 12-11 13:27:46.735 ERROR Failed to initialize objects for controller AndroidDevice, abort!
Traceback (most recent call last):
File "build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py", line 376, in register_controller
objects = create(controller_config)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 82, in create
_start_services_on_ads(ads)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
self.start_adb_logcat()
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
self.adb.shell("logpersist.stop --clear")
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
return self._exec_adb_cmd(clean_name, arg_str)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found
[SampleTestBed] 12-11 13:27:46.736 ERROR Failed to setup HelloWorldTest.
Traceback (most recent call last):
File "build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py", line 504, in run
self._setup_class()
File "build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py", line 128, in _setup_class
self.setup_class()
File "hello.py", line 11, in setup_class
self.ads = self.register_controller(android_device)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py", line 376, in register_controller
objects = create(controller_config)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 82, in create
_start_services_on_ads(ads)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 129, in _start_services_on_ads
ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 384, in start_services
self.start_adb_logcat()
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py", line 580, in start_adb_logcat
self.adb.shell("logpersist.stop --clear")
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 137, in adb_call
return self._exec_adb_cmd(clean_name, arg_str)
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 108, in _exec_adb_cmd
return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))
File "build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py", line 105, in _exec_cmd
raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)
AdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found
[SampleTestBed] 12-11 13:27:46.736 ERROR Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found
[SampleTestBed] 12-11 13:27:46.736 INFO [Test Case] setup_class FAIL
[SampleTestBed] 12-11 13:27:46.737 INFO Summary for test run SampleTestBed@12-11-2016_13-27-46-350: Error 0, Executed 1, Failed 1, Passed 0, Requested 1, Skipped 0