5

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.

jabadejat
  • 51
  • 1
  • 1
  • 4

2 Answers2

7

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"
Izzy
  • 91,166
  • 73
  • 343
  • 943
  • +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. – Firelord Sep 10 '15 at 16:17
  • @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. – Izzy Sep 10 '15 at 16:20
1

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

  • Is there anything equivalent for Windows? – jabadejat Sep 22 '14 at 08:51
  • 1
    @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. – Matthew Read Sep 22 '14 at 17:18
  • 5
    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. – Dan Hulme Dec 03 '14 at 16:23
  • How to obtain the size of Logcat: http://stackoverflow.com/questions/6321555/what-is-the-size-limit-for-logcat – kinunt Feb 09 '15 at 18:52
  • 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 Sep 10 '15 at 15:35
  • 1
    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 :) – Izzy Sep 10 '15 at 16:18