簡體   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