bat脚本自助查看进程pid并kill

320 阅读1分钟
adb.exe root
adb.exe remount
adb.exe shell setenforce 0



:: 设置要过滤的进程名

rem set /p process_name='android.hardware.broadcastradio@2.0-service'

adb.exe shell ps | findstr "android.hardware.broadcastradio@2.0-service" > pid_list.txt
for /f "tokens=2" %%i in (pid_list.txt) do (
    echo %%i
    adb.exe shell kill %%i
)
del pid_list.txt
echo "good!!!"
pause
`
```