yypgrep yy_pgrep can search the process name and return its PID. Usage: Compile it via Android.mk Then push it into Andriod device Run it in adb shell: yygrep mediaserver It like pgrep tool.