Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make adb shell ps list all processes in Android O?

adb shell ps not working in O android release

adb shell ps command in Android O release is listing only ps process information, but it is not listing all the processes information of all the process like it used to do it in earlier android releases

what is the command to list all the processes information in android O release?

like image 919
be_good_do_good Avatar asked Jun 24 '17 04:06

be_good_do_good


People also ask

How do I list files in adb shell?

Open cmd type adb shell then press enter. Type ls to view files list. At the DOS prompt, adb shell ls -R > junk lists all files and puts results into file junk which you can then edit via Notepad or whatever and see more than you'd want to, but your files, too!

What is adb shell PS?

What does adb shell ps command do? It is a command that is used to list thr running processes in Android.

How do I run multiple adb shell commands?

But, in order to execute several commands in one line, you may use adb shell "cmd1;cmd2;cmd3" . The && command mentioned by @Rachit is not quite right, because in the case adb shell "netcfg && ps && getprop" , command ps will be executed only when netcfg is executed without error raised.


2 Answers

Answer is: ps -A

But, there are so many new options in ps. Try running ps --help

generic_x86:/ $ ps --help usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]  List processes.  Which processes to show (selections may be comma separated lists):  -A  All processes  -a  Processes with terminals that aren't session leaders  -d  All processes that aren't session leaders  -e  Same as -A  -g  Belonging to GROUPs  -G  Belonging to real GROUPs (before sgid)  -p  PIDs (--pid)  -P  Parent PIDs (--ppid)  -s  In session IDs  -t  Attached to selected TTYs  -T  Show threads  -u  Owned by USERs  -U  Owned by real USERs (before suid)  Output modifiers:  -k  Sort FIELDs in +increasing or -decreasting order (--sort)  -M  Measure field widths (expanding as necessary)  -n  Show numeric USER and GROUP  -w  Wide output (don't truncate fields)  Which FIELDs to show. (Default = -o PID,TTY,TIME,CMD)  -f  Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)  -l  Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)  -o  Output FIELDs instead of defaults, each with optional :size and =title  -O  Add FIELDS to defaults  -Z  Include LABEL 
like image 22
nkalra0123 Avatar answered Sep 18 '22 15:09

nkalra0123


adb shell ps -A is listing all processes in android-8.0-O release.

I think Google has upgraded ps binary in this release.

like image 72
be_good_do_good Avatar answered Sep 19 '22 15:09

be_good_do_good