adb: Finden Sie PID aus der adb shell

Ich versuche die PID des Prozesses im INNEREN adb shell. So, ich mache adb shell, das bringt mich auf die android-shell. Nun, wenn ich wurden, um die PID-mit einem normalen shell-würde ich

adb shell ps | grep android.process.acore | sed 's/\s\s*//g' | cut -d ' ' -f 2

ODER

adb shell ps | grep android.process.acore | awk '{ print $2 }'

Bekomme ich die PID (eine numerische Zahl - 2. Feld der ps | grep android.process.acore) Ausgang.

Jedoch, wenn ich die oben genannten Befehle in android-shell(nach adb shell), bekomme ich /system/bin/sh: sed: not found und /system/bin/sh: awk: not found Fehler jeweils. Das heißt, diese Befehle nicht innerhalb der adb-shell. Allerdings grep funktioniert.

Den Ausgang des ps | grep android.process.acore innen adb shell ist:

XXX_x21   11826 441   502296 39028 ffffffff 4010ff6c S android.process.acore

Ich bin auf der Suche für die Nummer 11826.
Wie kann ich extrahieren Sie es in adb shell?

Bitte auch helfen, wenn es einen direkten Weg, um die PID innerhalb der adb-shell.

Grüße,
Rumit

Sie haben busybox installiert?

InformationsquelleAutor rumit patel | 2014-01-23

Schreibe einen Kommentar