diff --git a/devlib/utils/android.py b/devlib/utils/android.py index 001cb93..2be37cc 100755 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -359,7 +359,7 @@ class AdbConnection(ConnectionBase): popen.communicate() # pylint: disable=unused-argument - def execute(self, command, timeout=None, check_exit_code=False, + def execute(self, command, timeout=None, check_exit_code=True, as_root=False, strip_colors=True, will_succeed=False): if as_root and self.connected_as_root: as_root = False @@ -483,8 +483,7 @@ class AdbConnection(ConnectionBase): return try: # Try the new style of invoking `su` - self.execute('ls', timeout=self.timeout, as_root=True, - check_exit_code=True) + self.execute('ls', timeout=self.timeout, as_root=True) # If failure assume either old style or unrooted. Here we will assume # old style and root status will be verified later. except (TargetStableError, TargetTransientError, TimeoutError): diff --git a/doc/connection.rst b/doc/connection.rst index 71ce155..7f641d9 100644 --- a/doc/connection.rst +++ b/doc/connection.rst @@ -41,7 +41,7 @@ class that implements the following methods. transfer does not complete within this period, an exception will be raised. -.. method:: execute(self, command, timeout=None, check_exit_code=False, as_root=False, strip_colors=True, will_succeed=False) +.. method:: execute(self, command, timeout=None, check_exit_code=True, as_root=False, strip_colors=True, will_succeed=False) Execute the specified command on the connected device and return its output.