Thread View: comp.mobile.android
2 messages
2 total messages
Started by Maria Sophia
Wed, 04 Nov 2026 02:16
How can we accurately easily ID the most recent package that was run?
Author: Maria Sophia
Date: Wed, 04 Nov 2026 02:16
Date: Wed, 04 Nov 2026 02:16
19 lines
2112 bytes
2112 bytes
Q: How can we accurately easily ID the most recent package that was run? A: ? In a recent thread, someone asked for a feature that is common with most, but not with all software information device checkers, but since all the device checkers are infrequently run and they are all very similar in look and feel (even down to the names and launch icons), the question arose what the actual unique package name of the app that was just run, happens to be. 1. Test a series of package managers (most with similar icons & names) 2. When one has a successful run (e.g., saves the file)... then... 3. Instantly capture the unique name of that last package that was run But how? Q: What's an easy yet accurate way to determine the most recent package? A: ? -- We should strive to ask questions whose answers add to our knowledge.
Re: How can we accurately easily ID the most recent package that was run?
Author: Maria Sophia
Date: Sat, 07 Nov 2026 18:26
Date: Sat, 07 Nov 2026 18:26
35 lines
3996 bytes
3996 bytes
Maria Sophia wrote:
> Q: What's an easy yet accurate way to determine the most recent package?
> A: ?
Woo hoo.
I found a great way to find the last program run.
adb shell dumpsys usagestats | grep "ACTIVITY_RESUMED" | grep -vE "dreams\.basic|launcher|systemui|launcher3|wallpaper" | tail -1 | grep -oE "package=[^ ]+"
=> package=org.schabi.newpipe
Note:
where grep
=> C:\Program Files\coreutils\bin\grep.exe
where tail
=> C:\Program Files\coreutils\bin\tail.exe
Changing that only a teeny tiny bit, nets us the last Activity run!
adb shell dumpsys usagestats | grep "ACTIVITY_RESUMED" | grep -vE "dreams\.basic|launcher|systemui|launcher3|wallpaper" | tail -1 | grep -oE "class=[^ ]+"
=> class=org.schabi.newpipe.MainActivity
Note that I had to filter out sleep screens & launcher stuff
as this gets the last activity run, but since it's a sleep screen,
we need to filter out common stuff we're not interested in.
adb shell dumpsys usagestats | grep "ACTIVITY_RESUMED" | tail -1
time="2026-11-07 10:00:07" type=ACTIVITY_RESUMED package=com.android.dreams.basic class=android.service.dreams.DreamActivity instanceId=113775963 taskRootPackage=com.android.dreams.basic taskRootClass=android.service.dreams.DreamActivity flags=0x0
Diving down into the previous five activities, we find NewPipe was run.
adb shell dumpsys usagestats | grep "ACTIVITY_RESUMED" | tail -5
time="2026-11-07 10:00:07" type=ACTIVITY_RESUMED package=com.android.dreams.basic class=android.service.dreams.DreamActivity instanceId=113775963 taskRootPackage=com.android.dreams.basic taskRootClass=android.service.dreams.DreamActivity flags=0x0
time="2026-11-07 10:00:07" type=ACTIVITY_RESUMED package=com.android.dreams.basic class=android.service.dreams.DreamActivity instanceId=113775963 taskRootPackage=com.android.dreams.basic taskRootClass=android.service.dreams.DreamActivity flags=0x0
time="2026-11-07 10:13:03" type=ACTIVITY_RESUMED package=com.teslacoilsw.launcher class=com.teslacoilsw.launcher.NovaLauncher instanceId=22358917 taskRootPackage=com.teslacoilsw.launcher taskRootClass=com.teslacoilsw.launcher.NovaLauncher flags=0x0
time="2026-11-07 10:13:04" type=ACTIVITY_RESUMED package=com.teslacoilsw.launcher class=com.teslacoilsw.launcher.NovaLauncher instanceId=22358917 taskRootPackage=com.teslacoilsw.launcher taskRootClass=com.teslacoilsw.launcher.NovaLauncher flags=0x0
time="2026-11-07 10:13:09" type=ACTIVITY_RESUMED package=org.schabi.newpipe class=org.schabi.newpipe.MainActivity instanceId=1104153 taskRootPackage=org.schabi.newpipe taskRootClass=org.schabi.newpipe.MainActivity flags=0x0
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads