[Android Software/Hacking General [Developers Only]] zeppelinrox:
Hey so a few days ago I thought out loud about scanning current pids to see what app is the launcher and then thought about sorting all the pids by OOM groups

SO...

Here is another thingie but actually tested by me this time :D

2 versions in the following script... one quick and one verbose to see what you like better.

Copy all the code and past in a new script with script manager and call it...

zeppelinrox's OOM Stick!

echo "---==zeppelinrox's Quick OOM Stick Verifier==---"
echo ""
echo "ADJ PID Process"
echo ""
echo FOREGROUND APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt -16 ] && [ "`cat $i/oom_adj`" -lt 0 ]; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -eq 0 ]; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo HOME LAUNCHER!
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 0 ] && [ "`cat $i/oom_adj`" -lt 3 ] ; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo VISIBLE APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -eq 3 ]; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo SECONDARY SERVER
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 3 ] && [ "`cat $i/oom_adj`" -le 5 ] ; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo HIDDEN APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 5 ] && [ "`cat $i/oom_adj`" -le 7 ] ; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo CONTENT PROVIDER
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 7 ] && [ "`cat $i/oom_adj`" -le 14 ] ; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo EMPTY APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 14 ] && [ "`cat $i/oom_adj`" -le 15 ] ; then
echo -n "`cat $i/oom_adj` "
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
echo -n ${i##*/}
echo " $appname"
fi
fi
fi
done
echo ""
echo "================================================"
echo ""
echo "All Done"
echo ""
echo "----====zeppelinrox's OOM Stick Verifier====----"
echo ""
echo "ADJ PID Process/Path (APK)"
echo ""
echo FOREGROUND APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt -18 ] && [ "`cat $i/oom_adj`" -lt 0 ]; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -eq 0 ]; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo HOME LAUNCHER!
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 0 ] && [ "`cat $i/oom_adj`" -lt 3 ] ; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo VISIBLE APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -eq 3 ]; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo SECONDARY SERVER
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 3 ] && [ "`cat $i/oom_adj`" -le 5 ] ; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo HIDDEN APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 5 ] && [ "`cat $i/oom_adj`" -le 7 ] ; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo CONTENT PROVIDER
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 7 ] && [ "`cat $i/oom_adj`" -le 14 ] ; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo EMPTY APP
for i in $(ls -d /proc/*);
do
if [ -f "$i/oom_adj" ]; then
if [ -n "`cat $i/cmdline`" ]; then
if [ "`cat $i/oom_adj`" -gt 14 ] && [ "`cat $i/oom_adj`" -le 15 ] ; then
cmdline=`cat $i/cmdline`
appname=${cmdline##*/}
apkpath=`pm list packages -f $appname`
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo -n "`cat $i/oom_adj` "
echo -n ${i##*/}
if [ -n "$apkpath" ]; then
#	echo -n " $appname"
echo -n " $cmdline"
apkname=${apkpath#*:}
apkpath2=${apkname%%=*}
echo " ($apkpath2)"
else
#	echo " $appname"
echo " $cmdline"
fi
fi
fi
fi
done
echo ""
echo "================================================"
echo ""
echo "All Done"

The quick one doesn't include system processes and no apk information.

The verbose version takes awhile to finish but includes lots of information regarding running apps/processes.

If the process has a path it gets listed (usually system processes) and if there is an apk for the process, it gets listed.

As far as I can tell, most apps will have either one or the other and not both.

If anybody knows of a quicker way to get a running app's apk (I used pm ie. package manager) please let me know :)