Window上用批处理问题利用adb命令通过包名杀进程的方法
adb root
set pkgName="com.myapp.mymodule"
@echo *write the pid to a file*
@echo *read the content from file*
::adb shell ps | find %pkgName% > %pkgName%.txt
adb shell "echo $(ps -ef |grep creator) | cut -d' ' -f2" > %pkgName%.txt
set /p str=<.\%pkgName%.txt
set str="%str%"
echo str = %str%
adb shell kill %str%
REM Then delete the temp file %pkgName%.txt
del /s /q /f .\%pkgName%.txt
@pause