By jabadejat


2014-09-22 00:12:13 8 Comments

I don't know if there is already a thread about this particular issue, but if so forgive me. I would like to know how can I see the date when I installed and uninstalled a certain app some time ago (provided that I deleted it from Google Play history, so I can't go that way). I've been doing some research and logcat appears everywhere, but I don't see how can it solve my problem. Thanks in advance for your help.

2 comments

@Izzy 2015-09-10 16:11:00

Logcat won't be much help here, as it only lasts back a limited time (it uses a ring buffer with a fixed size, so older entries get overwritten with new ones). Instead, better focus on the package manager:

adb shell "pm list packages -u -3"

gives you a list of all apps you have installed (the -3 restricts it to apps that didn't come pre-installed – essentially meaning "3rd party"), including those you've already uninstalled (-u). The returned list looks like this:

package:com.ceco.gm2.gravitybox
package:com.mohammadag.xposedpreferenceinjector

This still doesn't give you the details you wanted, so lets bring in some help from Firelord's answer here:

First, we need to cut of the leading package:, so we modify our command to pm list packages -u -3 | awk -F: '{print $NF}':

com.ceco.gm2.gravitybox
com.mohammadag.xposedpreferenceinjector

Already better. Now Firelord kicks in mentioning the dumpsys command for details, which we integrate in what we have so far:

for pkg in $(pm list packages -u -3 | awk -F: '{print $NF}'); do
    dumpsys package $pkg
done

That should give you full details for each app, including their install date (firstInstallTime), last update (lastUpdateTime) and, hopefully also the uninstall-time – unfortunately, on the device I've tested this right now, uninstalled apps didn't turn up despite of the -u parameter, which might be a device-specific issue (as the pm documentation clearly describes it such).

To give you the same thing as a one-liner which also should work on Windows:

adb shell "for pkg in \$(pm list packages -u -3 | awk -F: '{print \$NF}'); do dumpsys package \$pkg; done"

@Firelord 2015-09-10 16:17:59

+1. I actually had the same approach in my mind but I rather posted a comment since that -u in pm didn't yield anything good to me.

@Izzy 2015-09-10 16:20:19

@Firelord OK, so it's not just me. Maybe it's a deprecated parameter no longer used since Android x.y. As usually, documentation is a rare thing with those.

@DreamCoder 2014-09-22 08:39:40

You can use this command on Linux:

adb shell logcat | grep install for install app see in logcat

adb shell logcat | grep uninstall for uninstall app see in logcat

Otherwise In windows you can use Cygwin. You can download from here

@jabadejat 2014-09-22 08:51:30

Is there anything equivalent for Windows?

@Matthew Read 2014-09-22 17:18:32

@jabadejat Grep is available for Windows, but not packaged by default. It should also be part of Busybox for Android, so that you could do the grep-ing on your device rather than your PC.

@Dan Hulme 2014-12-03 16:23:33

Since the log is stored in a circular buffer, so that old entries get overwritten typically within a day, this doesn't seem like it would help find the date of installing an app.

@kinunt 2015-02-09 18:52:02

How to obtain the size of Logcat: stackoverflow.com/questions/6321555/…

@Izzy 2015-09-10 15:35:05

On Windows: adb shell "logcat | grep install". Note the quotes: this tells adb shell to run the whole thing on Android – where it finds the logcat command as well as grep. But the point is: limited use. This way you might see what happened in the last few minutes – but for sure not a couple of days back.

@Izzy 2015-09-10 16:18:51

PS: I've just done a test-uninstall. Your command didn't yield that. What worked: adb shell "logcat -v time | grep -i uninstall". Note the -i for case insensitive grep (the log has it as "Uninstall"), plus the -v time parameter (OP wanted to see when that happened, not only that it happened :)

Related Questions

Sponsored Content

1 Answered Questions

debugging frequent crashes/reboot with nexus 6p

1 Answered Questions

2 Answered Questions

[SOLVED] Can't install apps after factory reset

3 Answered Questions

1 Answered Questions

Sponsored Content