Merge "The "ps" command has changed in Android O" am: 1fc6d09b95
am: cb79a8c79c
Change-Id: I52e471c96a695454191fa3ed17e9cc456e69460a
This commit is contained in:
@@ -86,6 +86,9 @@ def get_processes(device):
|
|||||||
# busybox truncates the output, and very long package names like
|
# busybox truncates the output, and very long package names like
|
||||||
# com.exampleisverylongtoolongbyfar.plasma exceed the limit.
|
# com.exampleisverylongtoolongbyfar.plasma exceed the limit.
|
||||||
#
|
#
|
||||||
|
# API 26 use toybox instead of toolbox for ps and needs -A to list
|
||||||
|
# all processes.
|
||||||
|
#
|
||||||
# Perform the check for this on the device to avoid an adb roundtrip
|
# Perform the check for this on the device to avoid an adb roundtrip
|
||||||
# Some devices might not have readlink or which, so we need to handle
|
# Some devices might not have readlink or which, so we need to handle
|
||||||
# this as well.
|
# this as well.
|
||||||
@@ -95,10 +98,12 @@ def get_processes(device):
|
|||||||
|
|
||||||
ps_script = """
|
ps_script = """
|
||||||
if $(ls /system/bin/readlink >/dev/null 2>&1); then
|
if $(ls /system/bin/readlink >/dev/null 2>&1); then
|
||||||
if [ $(readlink /system/bin/ps) == "toolbox" ]; then
|
if [ $(readlink /system/bin/ps) == "busybox" ]; then
|
||||||
ps;
|
|
||||||
else
|
|
||||||
ps -w;
|
ps -w;
|
||||||
|
elif [ $(readlink /system/bin/ps) == "toybox" ]; then
|
||||||
|
ps -A;
|
||||||
|
else
|
||||||
|
ps;
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
ps;
|
ps;
|
||||||
|
|||||||
Reference in New Issue
Block a user