7

I have already posted this on Reddit, but I might reach a better audience here.


I "uninstalled" Google Play Games using this guide by XDA. Now I need to reinstall it. This is the command, how I should be able to reinstall the app: adb shell cmd package install-existing <name of package>. But there is one problem: My phone is on Android Lollipop, and the command doesn't exist there. I manually tried to install the apk back, with adb and with the normal package installer. The Settings app always says something like "Not installed for user" (translated from another language).

So I have 2 questions:

  1. In which Android version was this command introduced?
  2. How can I get this app back?

PS: I have root access, but would prefer a non-rooted solution.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
user11227590
  • 71
  • 1
  • 1
  • 2
  • @Firelord dumpsys (Play Store): https://pastebin.com/bCApNT0S path (Play Store): package:/data/app/com.android.vending-1/base.apk
    dumpsys (Play Games): https://pastebin.com/2r9y7kQp path (Play Games): (Empty)
    – user11227590 Apr 13 '19 at 09:53
  • My apologies. I got confused with Play Store. Instead of using system app path, can you try with this: adb shell pm install -r --user 0 /data/app/com.google.android.play.games-1/*.apk. I tried this approach on Google Calendar app on Oreo and it worked, that's why I am suggesting this. – Firelord Apr 13 '19 at 15:44
  • 1
    @Firelord it says 'Success', but still 'Not installed for user' in Settings. Damn, I got a headache from this. Screenshot here. – user11227590 Apr 14 '19 at 09:05
  • 3
    Last resort would be a factory reset. But looking at the help of the cmd command, it might be worth trying adb shell "cmd package compile --reset com.google.android.play.games". Also, though I doubt it works it cannot hurt: pm enable --user 0 <pkg>, pm unhide --user 0 <pkg>. – Izzy Apr 27 '19 at 09:25
  • 1
    In XDA developers forum, I found that the command adb shell cmd package install-existing <name of package> can reinstall an uninstalled system app for the current user. But, when I tried it in my Android 7.0 smartphone, it showed an error that the command install-existing could not be found. Can this command be modified to get some result? – Puspam Aug 15 '19 at 13:26
  • 1
    pm enable --user 0 worked for me! thanks! – 张实唯 Oct 14 '19 at 13:40
  • 1
    for me cmd package install-existing inside adb shell worked – Maciej Bledkowski Feb 07 '21 at 19:39

1 Answers1

1

First, enable the package by using pm enable --user 0 <pkg>, and then install it by using cmd package install-existing <pkg>.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123