{"action":"created","issue":{"url":"https://api.github.com/repos/google/mobly/issues/22","repository_url":"https://api.github.com/repos/google/mobly","labels_url":"https://api.github.com/repos/google/mobly/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/google/mobly/issues/22/comments","events_url":"https://api.github.com/repos/google/mobly/issues/22/events","html_url":"https://github.com/google/mobly/issues/22","id":194847798,"number":22,"title":"logpersist missing.","user":{"login":"shauvik","id":141353,"avatar_url":"https://avatars.githubusercontent.com/u/141353?v=3","gravatar_id":"","url":"https://api.github.com/users/shauvik","html_url":"https://github.com/shauvik","followers_url":"https://api.github.com/users/shauvik/followers","following_url":"https://api.github.com/users/shauvik/following{/other_user}","gists_url":"https://api.github.com/users/shauvik/gists{/gist_id}","starred_url":"https://api.github.com/users/shauvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shauvik/subscriptions","organizations_url":"https://api.github.com/users/shauvik/orgs","repos_url":"https://api.github.com/users/shauvik/repos","events_url":"https://api.github.com/users/shauvik/events{/privacy}","received_events_url":"https://api.github.com/users/shauvik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-11T18:38:38Z","updated_at":"2016-12-12T19:03:49Z","closed_at":null,"body":"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?\r\n\r\n```\r\n$python hello.py -c config.json\r\n[SampleTestBed] 12-11 13:27:46.351 INFO ==========> HelloWorldTest <==========\r\n[SampleTestBed] 12-11 13:27:46.625 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start adb logcat!\r\nTraceback (most recent call last):\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 384, in start_services\r\n    self.start_adb_logcat()\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 580, in start_adb_logcat\r\n    self.adb.shell(\"logpersist.stop --clear\")\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 137, in adb_call\r\n    return self._exec_adb_cmd(clean_name, arg_str)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 108, in _exec_adb_cmd\r\n    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 105, in _exec_cmd\r\n    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)\r\nAdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found\r\n\r\n[SampleTestBed] 12-11 13:27:46.626 ERROR [AndroidDevice|DEVICE_ID_REDACTED] Failed to start some services, abort!\r\nTraceback (most recent call last):\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 129, in _start_services_on_ads\r\n    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 384, in start_services\r\n    self.start_adb_logcat()\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 580, in start_adb_logcat\r\n    self.adb.shell(\"logpersist.stop --clear\")\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 137, in adb_call\r\n    return self._exec_adb_cmd(clean_name, arg_str)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 108, in _exec_adb_cmd\r\n    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 105, in _exec_cmd\r\n    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)\r\nAdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found\r\n\r\n[SampleTestBed] 12-11 13:27:46.735 ERROR Failed to initialize objects for controller AndroidDevice, abort!\r\nTraceback (most recent call last):\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py\", line 376, in register_controller\r\n    objects = create(controller_config)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 82, in create\r\n    _start_services_on_ads(ads)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 129, in _start_services_on_ads\r\n    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 384, in start_services\r\n    self.start_adb_logcat()\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 580, in start_adb_logcat\r\n    self.adb.shell(\"logpersist.stop --clear\")\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 137, in adb_call\r\n    return self._exec_adb_cmd(clean_name, arg_str)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 108, in _exec_adb_cmd\r\n    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 105, in _exec_cmd\r\n    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)\r\nAdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found\r\n\r\n[SampleTestBed] 12-11 13:27:46.736 ERROR Failed to setup HelloWorldTest.\r\nTraceback (most recent call last):\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py\", line 504, in run\r\n    self._setup_class()\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/base_test.py\", line 128, in _setup_class\r\n    self.setup_class()\r\n  File \"hello.py\", line 11, in setup_class\r\n    self.ads = self.register_controller(android_device)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/test_runner.py\", line 376, in register_controller\r\n    objects = create(controller_config)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 82, in create\r\n    _start_services_on_ads(ads)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 129, in _start_services_on_ads\r\n    ad.start_services(skip_sl4a=getattr(ad, KEY_SKIP_SL4A, False))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 384, in start_services\r\n    self.start_adb_logcat()\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device.py\", line 580, in start_adb_logcat\r\n    self.adb.shell(\"logpersist.stop --clear\")\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 137, in adb_call\r\n    return self._exec_adb_cmd(clean_name, arg_str)\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 108, in _exec_adb_cmd\r\n    return self._exec_cmd(' '.join((self.adb_str, name, arg_str)))\r\n  File \"build/bdist.macosx-10.11-x86_64/egg/mobly/controllers/android_device_lib/adb.py\", line 105, in _exec_cmd\r\n    raise AdbError(cmd=cmd, stdout=out, stderr=err, ret_code=ret)\r\nAdbError: Error executing adb cmd 'adb -s DEVICE_ID_REDACTED shell logpersist.stop --clear'. ret: 127, stdout: , stderr: /system/bin/sh: logpersist.stop: not found\r\n\r\n[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\r\n\r\n[SampleTestBed] 12-11 13:27:46.736 INFO [Test Case] setup_class FAIL\r\n[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\r\n```"},"comment":{"url":"https://api.github.com/repos/google/mobly/issues/comments/266520373","html_url":"https://github.com/google/mobly/issues/22#issuecomment-266520373","issue_url":"https://api.github.com/repos/google/mobly/issues/22","id":266520373,"user":{"login":"xpconanfan","id":2242277,"avatar_url":"https://avatars.githubusercontent.com/u/2242277?v=3","gravatar_id":"","url":"https://api.github.com/users/xpconanfan","html_url":"https://github.com/xpconanfan","followers_url":"https://api.github.com/users/xpconanfan/followers","following_url":"https://api.github.com/users/xpconanfan/following{/other_user}","gists_url":"https://api.github.com/users/xpconanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/xpconanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xpconanfan/subscriptions","organizations_url":"https://api.github.com/users/xpconanfan/orgs","repos_url":"https://api.github.com/users/xpconanfan/repos","events_url":"https://api.github.com/users/xpconanfan/events{/privacy}","received_events_url":"https://api.github.com/users/xpconanfan/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T19:03:49Z","updated_at":"2016-12-12T19:03:49Z","body":"Thanks for reporting the issue!\r\n\r\nWhat kind of build are you using? You can check with adb command:\r\n`$ adb shell getprop ro.build.type`\r\n\r\nI'll upload a patch to handle this better. Sorry about the trouble.\r\n\r\nlogpersist only works on 'userdebug' build, so if you want to store all log caches on your device, you'll need to use a 'userdebug' build on your phone."}}
{"actor":{"display_login":"xpconanfan"}}