首页 > 关于shell脚本killapk的问题

关于shell脚本killapk的问题

kill -9 $(ps -A|awk '/进程名/{print $1}')

我写了一句话 然后在cmd里面 sh *.sh 运行这个脚本的时候报错 awk notfound
could not kill pid -9 :not such process

然后我把上面那句改成 kill ps -ef|grep text2

就报错 grep not found 这是怎么回事啊 not found grep 和awk 是怎么回事啊

我是在adb shell下运行这个脚本的

得怎么获取运行后程序的pid啊


获取进程pid

ps 进程名

如 app进程是这样获取

ps com..app

grep awk是linux下脚本命令,adb shell是不支持的。

【热门文章】
【热门文章】