I am trying to get the PID of the process INSIDE adb shell. So, I am doing adb shell which gets me to the android shell. Now, if I were to get the PID using a regular shell
I tried this one and it seems to work:
adb shell "set "ps | grep android.process.media"; kill -9 $2"