From bb4c479a773ad5233671eb299e5119bde9b47f1f Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:08:46 +0100 Subject: [PATCH] fix adb ps exec for old device --- keydive/adb.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/keydive/adb.py b/keydive/adb.py index 0aab691..a6915a8 100644 --- a/keydive/adb.py +++ b/keydive/adb.py @@ -190,12 +190,8 @@ class ADB: # Try to get the list of processes using `ps -A` prompt = [*self.prompt, 'ps'] sp = shell([*prompt, '-A']) - - if sp.returncode != 0: - self.logger.error('Failed to execute ps -A command (Error: %s)', sp.stderr.decode('utf-8').strip()) - return processes - lines = sp.stdout.decode('utf-8').splitlines() + # If the output has less than 10 lines, try the alternative `ps` command if len(lines) < 10: sp = shell(prompt)