我想知道如何检查用户在 Android 手机(终端)中执行的最后一个应用程序。我正在使用ps
命令进行检查,但没有显示时间戳。我想得到的是用户执行的最后一个应用程序的 PID。
有什么建议吗?
此致
I would just use
adb logcat
and check for the last user application which was executed (the pid is in the brackets). I doubt there's an more reliable way to retrieve this information as there might a lot of background process (own pid, own user) involved or running without connection to the last user process.
您还应该注意,要获取此类信息,您可能必须拥有一部有根电话