adb shell am force-stop XXX
其中XXX是app的包名,發現進程還在,而且ps看進程號不變,也就是此包沒有被stop掉,在android 8.1系統中。
其實在android8.1中的代碼中:
if (app.persistent && !evenPersistent) {
// we don't kill persistent processes
continue;
}
應用中android:persistent="true",
true 就不讓force-stop。