繁体   English   中英

从ADB / Shell命令模拟强制停止

[英]Emulate Force Stop from ADB/Shell Commands

有没有办法使用当前的命令行工具( adbampm )来模拟用户从设置应用程序按下强制停止? 从shell调用kill <pid>只能模拟系统杀死进程时发生的事情,但Force Stop通过删除Android保存的ActivityRecord实例来删除应用程序的内存。

我们可以调用shell命令来模拟这种相同的行为吗?

干杯。

使用

am force-stop: force stop everything associated with <PACKAGE>.

am kill: Kill all processes associated with <PACKAGE>.  Only kills.
  processes that are safe to kill -- that is, will not impact the user
  experience.

例如:

adb shell am force-stop <PACKAGE>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM