[英]Emulate Force Stop from ADB/Shell Commands
有沒有辦法使用當前的命令行工具( adb
, am
, pm
)來模擬用戶從設置應用程序按下強制停止? 從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.