Android, DISABLE or uninstall more bloat on non-rooted devices (here an S8)

When normal uninstall or disable is not available for an app, we DO have a bigger axe for trimming devices, even un-rooted ones :mrgreen:

(image from here)

**For a brief version read HERE!***

 

Below the looooong version with examples

 

UPDATE 2018-10-09: The below has been rewritten with “disable-user”, and the original “uninstall” toned down.

On Android, benign apps can be uninstalled (or at the least disabled) under Settings, Apps, for each app.

But unfortunately quite some bloat apps, does NOT fall in the benign category. Both by Google, the manufacturer and for branded devices by the carrier…

Yet all hope are not lost as we can do something using a pc! We can either Disable or LOGICALLY uninstall an app using a pc, even on non-rooted devices!!

Disable is reversible. But uninstall can (to my knowledge…) not be reverted on locked devices – though you can of course always do a factory reset. [*] See later for a re-install syntax, with some quirks though!

 

Below is from my Samsung S8, with info merged from
A mail from the guy behind must-have apps like 3c Battery Monitor that is part of 3c All-in-One Toolbox that I highly recommend.
https://forum.xda-developers.com/galaxy-s9-plus/help/list-bloatware-youd-recommend-to-rid-off-t3759500
https://www.androidsage.com/2018/08/29/how-to-remove-disable-uninstall-remap-bixby-button-samsung-galaxy-note-9-note-8-s9-s8

 

Here is the recipe with some examples

Connect the device to a PC (windows or mac), accept displayed prompts.

If not already enabled, on the device enable Developer Options (Under Settings About, Software information, click multiple times on Build number)

In Settings, Developer Options, set the USB-debugging mode TEMPORARILY to ON – remember to set to OFF again afterwards!!

On the PC find ADB.EXE (if not installed, it can be fetches officially here – be sure to fetch from a trustworthy site)

Open a CMD-box (no special privileges needed on the PC-side) and go to the suitable directory.

To check that it is Connected, and debugging is ON, enter the below, if it is, a device ID is listed (here a faked id)

ADB devices

List of devices attached
abcd1234abcd1234ab device

 

Here the disable-user syntax on devices with newer Android (Before M, use “disable”)
Due to a strange decision somewhere, disabling an app, does NOT mean that it is also stopped, so you need to EXPLICITLY stop it also. More on that after the disabling…
The good thing about disable-user is that it is reversible, the bad is that the junk is still there (but it does not completely disappear with pm uninstall either)

 

To address stuff we want to get rid of, we need to know/guess the package name, it is not directly visible from the Apps UI, but many tools can help with that, e.g. this.

ADD: With Android 9 Pie they seem to have added a THIRD name for some, that is shown in the Settings Apps – this can make things a bit more confusing….
“Hiya Service” was on Oreo called “android-ss-service-lib”, and has the package name “com.hiya.star”
Similar for some others. (e.g. the new name “Device Care”, is still handled as “Device Manager”)
So some of the below are not 100% correct packages names. For a script adjusted for Android 9 Pie, see this post

The below is Android 8.0.1 Oreo:

To get rid of BIXBY I checked for what contains “bixby” – it is not always that easy to know exactly what to search for, and more exists hiding behind odd names.

Be aware that ADB is case sensitive, for both commands and parameters

ADB shell pm list packages bixby

package:com.samsung.android.bixby.agent
package:com.samsung.android.bixby.es.globalaction
package:com.samsung.android.bixby.wakeup
package:com.samsung.android.bixby.plmsync
package:com.samsung.android.bixby.voiceinput
package:com.samsung.systemui.bixby
package:com.samsung.android.bixby.agent.dummy

And get rid of each:

ADB shell pm disable-user com.samsung.android.bixby.agent
ADB shell pm disable-user com.samsung.android.bixby.es.globalaction
ADB shell pm disable-user com.samsung.android.bixby.wakeup
ADB shell pm disable-user com.samsung.android.bixby.plmsync
ADB shell pm disable-user com.samsung.android.bixby.voiceinput
ADB shell pm disable-user com.samsung.android.bixby.agent.dummy
ADB shell pm disable-user com.samsung.systemui.bixby

…And a few extra parts with names hard to guess (here I used “system info for android” )

ADB shell pm disable-user com.samsung.android.visionintelligence
ADB shell pm disable-user com.samsung.android.app.spage

 

To get rid of Faecesbook

ADB shell pm list packages facebook

package:com.facebook.services
package:com.facebook.katana
package:com.facebook.system
package:com.facebook.appmanager

ADB shell pm disable-user com.facebook.services
ADB shell pm disable-user com.facebook.katana
ADB shell pm disable-user com.facebook.system
ADB shell pm disable-user com.facebook.appmanager

 

To get rid of “Sport

ADB shell pm list packages sport

package:com.samsung.android.widgetapp.yahooedge.sport
package:com.google.android.backuptransport

(Note the false positive of the search: tranSPORT)

ADB shell pm disable-user com.samsung.android.widgetapp.yahooedge.sport

 

To get rid of “Finance

ADB shell pm list packages finance

package:com.samsung.android.widgetapp.yahooedge.finance

ADB shell pm disable-user com.samsung.android.widgetapp.yahooedge.finance

 

To get rid of “Samsung Voice, after first searching “voice” I found out it was “svoice”

ADB shell pm list packages svoice

package:com.samsung.svoice.sync
package:com.samsung.android.svoice

ADB shell pm disable-user com.samsung.svoice.sync
ADB shell pm disable-user com.samsung.android.svoice

 

Here used to disable Samsungs Gallery

adb shell pm list packages gall

package:com.sec.android.gallery3d

adb shell pm disable-user com.sec.android.gallery3d

 

Here for the sticker-stuff

adb shell pm list packages stick

package:com.samsung.android.provider.stickerprovider
package:com.samsung.android.app.camera.sticker.facear.preload
package:com.samsung.android.stickercenter
package:com.samsung.android.app.camera.sticker.stamp.preload

adb shell pm disable-user com.samsung.android.app.camera.sticker.facear.preload
adb shell pm disable-user com.samsung.android.app.camera.sticker.stamp.preload
adb shell pm disable-user com.samsung.android.stickercenter
adb shell pm disable-user com.samsung.android.provider.stickerprovider

 

Of course other bloat can also be disabled, but I think you got the picture by now… See below for script

NOTE To each disable we need to explicitly stop it also (most of them are started, and they are NOT stopped by a disable!!!)

You will need to copy the commands and replace “pm disable-user” with “am force-stop”ย (some -not all- you can alternatively stop from within the UI, but much more cumbersome one by one). You most likely also want to clear the cache and data for the disabled app (do not expect the storage usage to go to zero though…)

Here an example:

adb shell pm disable-user com.sec.android.gallery3d
adb shell am force-stop   com.sec.android.gallery3d
adb shell pm clear        com.sec.android.gallery3d

If you later wish to, you can reenable it by

adb shell pm enable com.sec.android.gallery3d

(note it is “enable” not “enable-user”)

 

On the phone/phablet, set the debugging option back to increase security:
In Settings, Developer Options, Set the usb-debugging back to mode OFF

 

My (current 2018-12-13) BAT-script for butchering additional bloat on the S8

@If %1.==. goto calls
ADB shell pm disable-user %1
ADB shell am force-stop   %1
ADB shell pm clear        %1
@goto :EOF

:calls
@Echo Make sure the device is connected, and USB-debugging is enabled (and preferable pull the dos-box of this wide)
@Pause

REM ---------- Gallery
@Call %0 com.sec.android.gallery3d

REM ---------- Stickers, "Default live sticker", "Default stamp", "StickerCentre", "StickerProvider"
@Call %0 com.samsung.android.app.camera.sticker.facear.preload
@Call %0 com.samsung.android.app.camera.sticker.stamp.preload
@Call %0 com.samsung.android.stickercenter
@Call %0 com.samsung.android.provider.stickerprovider

REM ---------- Game Launcher , Game Tools
@Call %0 com.samsung.android.game.gamehome
@Call %0 com.samsung.android.game.gametools

REM ---------- Samsung Cloud
@Call %0 com.samsung.android.scloud

REM ---------- Gallaxy Apps, Gallaxy Essential Widget
@Call %0 com.sec.android.app.samsungapps
@Call %0 com.sec.android.widgetapp.samsungapps

REM ---------- Samsung Service Push
@Call %0 com.sec.spp.push

REM ---------- Gear VR Service
@Call %0 com.samsung.android.hmt.vrsvc

REM ---------- WithTV
@Call %0 com.samsung.android.app.withtv 

REM ---------- Voice Assitant
@Call %0 com.samsung.android.app.talkback 

REM ---------- Samsung Galaxy Friends
@Call %0 com.samsung.android.mateagent

REM ---------- Samsung DeX Home, Samsung DeX
@Call %0 com.sec.android.app.desktoplauncher
@Call %0 com.sec.android.desktopmode.uiservice

REM ---------- Photo Editor
@Call %0 com.sec.android.mimage.photoretouching

REM ---------- "Samsung Internet Panel", "Tasks edge" ,"Apps edge", "Clipboard Edge", "People Edge", "EdgeScreen"
@Call %0 com.samsung.android.app.sbrowseredge
@Call %0 com.samsung.android.app.taskedge
@Call %0 com.samsung.android.app.appsedge
@Call %0 com.samsung.android.app.clipboardedge
@Call %0 com.samsung.android.service.peoplestripe
@Call %0 com.samsung.android.app.cocktailbarservice

REM ---------- "Samsung Connect", "Samsung Connect", ?????
@Call %0 com.samsung.android.easysetup 
@Call %0 com.samsung.android.beaconmanager
@Call %0 com.samsung.android.oneconnect

REM ---------- Smartthings
@ECHO, ***YES*** the following disable fails - but stop works:
@Call %0 com.samsung.android.ststub

REM ---------- Div Bixby
@Call %0 com.samsung.android.bixby.agent
@Call %0 com.samsung.android.bixby.es.globalaction
@Call %0 com.samsung.android.bixby.wakeup
@Call %0 com.samsung.android.bixby.plmsync
@Call %0 com.samsung.android.bixby.voiceinput
@Call %0 com.samsung.android.bixby.agent.dummy
@Call %0 com.samsung.systemui.bixby
@Call %0 com.samsung.android.visionintelligence
@Call %0 com.samsung.android.app.spage

REM ---------- Div FaecesBook
@Call %0 com.facebook.services
@Call %0 com.facebook.katana
@Call %0 com.facebook.system
@Call %0 com.facebook.appmanager

REM ---------- Sport
@Call %0 com.samsung.android.widgetapp.yahooedge.sport

REM ---------- Finance
@Call %0 com.samsung.android.widgetapp.yahooedge.finance

REM ---------- Samsung Voice
@Call %0 com.samsung.svoice.sync
@Call %0 com.samsung.android.svoice

REM ---------- Calendar (Greenish icon)
@Call %0 com.samsung.android.calendar

REM ---------- Game Optimizing Service
@Call %0 com.enhance.gameservice

REM ---------- IMS Settings
@Call %0 com.samsung.advp.imssettings

REM ---------- Samsung Text-to-speech engine
@Call %0 com.samsung.SMT

REM ---------- "Samsung Themes", "Themes", UPSM="Ultra Power Saving Mode"
@Call %0 com.samsung.android.themestore
@Call %0 com.samsung.android.themecenter
@Call %0 com.samsung.upsmtheme


REM ---------- Google Text-To-Speech
@ECHO Accesibilities can not handle if this is disabled, so STOP only
REM @Call %0 com.google.android.tts
ADB shell am force-stop   com.google.android.tts


REM ---------- Samsung "Sound detector"
@call %0 package:com.samsung.android.app.advsounddetector
:EOF

 

Here a collage of the (currently) disabled. (Some through the UI the rest with the above)

(You may note that some are marked “Not installed”, see a little later on that…)

Apart from that I uninstalled a few Samsung apps the regular way

After disabling and stopping the above bloat, the idle consumption (while I sleep) has gone down from 0.4%/h to 0.2%/h (And 0.4% was AFTER uninstalling/disabling the few allowed from within the UI)

to

Now the main culprit apart from the ‘system’ is the mail, (On my Priv it was typically around 1%, but of a faster discharge, so probably roughly the same amount of energy used)

Note that the ‘Firewall’ got substantially less to do too, I assume due to some of the data stealing has been reduced too (nice side effect!!)

And as can be seen the vast majority (87%) of the idle power-consumption is now communicating with the cell tower! (So the usage in aeroplane mode can be expected to be almost nothing).

(This usage can be slightly reduced If I place the phone on the window sill. I got about 33% at ‘High – 4″ – when I tried that one night last week)

The Priv was also at around 0.4%/h when idle. With very low usage I had 0.5%/h in mean over a week, see this.
So ‘slimmed down’ for the worst bloat the S8 is (even) leaner on the battery. As expected with a newer chispset. And I did not know the above method until recently, so never trimmed any of the stuff that could not be disabled through the UI on the Priv.

BUT nothing like “Android System” or “Kernel” did even get in the top 14 on the Priv over the 1 week period above, so at the highest 0.1% of battery…
So this must mean that there is still a LOT of bloat still hiding as system that should be weeded out on the S8… (Or that the Android Marshmallow with BB’s patches is just better optimized than Oreo with Samsung’s)

 

[*]

The ADBย  does apart from disable-user and uninstall also offer other options like hide and unhide, though not mentioned in the more comprehensive guide here, but I get a permission error if I try…

The disable option seems to have been deprecated on newer Android, and been replaced by disable-user. I also get a permission error trying the disable.

Others seem to NOT experience the same limitation, so it MIGHT be something that is dependent on the Android version, or particular implementation of it, or unlocked bootloader. I’m currently on 8.0.0 on a Galaxy S8 (SM-G950F, exynos)

To test if I could reinstall after uninstall, I have tried to do it with the install -r, but get an error -3001, just like this and this – so either not possible, or we are making the same error). ADD see details further down, also a different mostly working syntax.

 

PS

Note that there is a package that appears in a rather odd way.

com.samsung.upsmtheme

Seen from ADB shell pm list packages , it is not hidden in any way. But you can not see it from within the device. Tried 3C Toolbox and other tools…

This is almost certainly the dark theme used by the MAX Power Saving Mode (selectable in Device Manager, Battery), that was previously known as “Ultra Power Saving Mode”. See e.g. here

(I have confirmed this by repeatedly listing the disabled packages while turning on UPSM / MAX , and the package is enabled before the mode cuts of the ADB connection. And the package is disabled when returning to the normal mode)

 

 


THE BELOW IS PRIMARILY NERDY, and related to the uninstalls I did before the disable-user


 

Before I learned the disable-user I used the more drastic uninstall

What I did looks very much like the above, but with the more drastic uninstall

e.g.

ADB shell pm uninstall -k --user 0 com.samsung.android.widgetapp.yahooedge.sport

rather than

ADB shell pm disable-user com.samsung.android.widgetapp.yahooedge.sport

 

If you do not care about the data of the apps, you could do the uninstall WITHOUT the “-k” parameter (k for “Keep data”)

 

Attempted reinstall of visible app.

(the below was still before I knew the disable-user syntax worked, so done while enabled)

I also tried to forcibly uninstall an app that appears in the Android Market as an installed app, but not uninstallable:

Note the Open, with no action to the left.

ADD: This app proved to be missed by some Samsung apps, including the camera, so think twice before uninstalling

I then tried to uninstall it forcibly as above:

ADB shell pm list packages gallery

package:com.sec.android.gallery3d

ADB shell pm uninstall -k --user 0 com.sec.android.gallery3d

Success

Then it appears as “uninstalled”

And I tried to reinstall it, and this fails (also after a restart)

(the link just give general suggestions.)

ADD: Thanks to a hint by GLumpy in the comments below, I got the right syntax for ‘re-installing’ ๐Ÿ™‚

ADB shell cmd package install-existing com.sec.android.gallery3d

It worked fine for this, though not completely for my first attempts on the yahoo-stuff, where icon/widget does not reappear (even after a restart)

ADD: Note that this syntax does only work from version 8.0 (thanks to w1nst0n for pointing this out)

 

So IF a forcible uninstalled app can be reinstalled unrooted, I assume it must be done through ADB.

So by the packet info here

ADB shell pm list packages -u -f gallery

package:/system/priv-app/SecGallery2015/SecGallery2015.apk=com.sec.android.gallery3d

I tried these eight variants

ADB shell pm install -r --user 0 -i com.sec.android.gallery3d /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install -r --user 0 /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install -r -i com.sec.android.gallery3d /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install -r /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install --user 0 -i com.sec.android.gallery3d /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install --user 0 /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install -i com.sec.android.gallery3d /system/priv-app/SecGallery2015/SecGallery2015.apk
ADB shell pm install /system/priv-app/SecGallery2015/SecGallery2015.apk

All returning

Failure [-3001]

So I’m in the dark on how any reinstall could be done (even for the apps visible in the Android Market).

I have tried to remove the develop setting “Verify apps via USB” also

In Oreo the general “Unknown Sources” have been replaced by a new “Install Unknows Apps“, that leeds to a list of apps that are allowed to install unknown APKs.
(The same list can be accessed from Settings, Apps, ellipsis, Special Access, Install Unknown Apps)
I here tried to click the elipsis, and select Show System Apps. But I can not find anything that reflects what is accessed through ADB, the least unlikely candidate is “CaptivePortalLogin” – but that was not it…

Note thatย  in the comments below got re-install working just fine on a Xiaomi device with Pie, with the first of the above eight variants, so must be a Samsung issue – or some setting somewhere I have overlooked on my S8, maybe some security feature that has to been turned temporarily off… OR it is related to her phone having an unlocked bootloader.

 

Be carefull uninstalling the sticker-stuff

Before I knew the disable-user I removed the sticker stuff, and -to my surprise- this seems to have further reduced the ‘system’ activity overnight!
(BTW tried without the -k switch to do the reinstall tests)

ADB shell pm list packages stick

package:com.samsung.android.provider.stickerprovider
package:com.samsung.android.stickercenter
package:com.samsung.android.app.camera.sticker.facear.preload
package:com.samsung.android.app.camera.sticker.stamp.preload

Do NOT uninstall the provider, Samsung’s camera-app closes after about 4s! A factory reset was needed to clear up my mess!!
Also note that IF the stickercentre and stickers are uninstalled, and you click the (fixed) stickers icon in the camera-app it stops the camera!

ADB shell pm uninstall --user 0 com.samsung.android.provider.stickerprovider
ADB shell pm uninstall --user 0 com.samsung.android.app.camera.sticker.facear.preload
ADB shell pm uninstall --user 0 com.samsung.android.app.camera.sticker.stamp.preload
ADB shell pm uninstall --user 0 com.samsung.android.stickercenter

Did a factory reset to clear up the mess caused by this (ADD: as pointed out by kuba below, an install-existing would have fixed it) and when I later learned the disable-user, I did that instead on the sticker-stuff, and disabling it has no side-effects.

58 thoughts on “Android, DISABLE or uninstall more bloat on non-rooted devices (here an S8)

  1. Faecesbook is still preinstalled on Samsung phones? o.O I guess Zuckerberg must pay them well. It’s good there’s a way around this. I wonder if these applications would come back after updates. I’d like to completely get rid of stuff like Google Search, and really almost every Google application, including more useful stuff like Maps. No reason to have them as system applications when I can always install them from Store and they anyway get updates frequently rendering the system apk file to be useless.

    Also these newer Android phones have two partition sets named “A” and “B”. I wonder how this removal is being handled. I think they have the system apks multiplied as well, I’ve seen when flashing my phone from PC it sends every package twice for both partition sets.

    1. I assume he is… And not even easy to remove…

      The

      “shell pm uninstall …”
      is not removing the apk, nor is it eliminating the package. You can still see it with a

      “shell pm list packages -u”
      BUT it is treated as unavailable, that its it is marked as “uninstalled” (as shown in the screen dump)
      After the forced uninstall, an app like Faecesbook nether appears In the “Installed” nor the “Library” tab in the Android Market.
      I have not (yet) been curious enough to see what happens if I try to re-install a forced uninstalled app through Android Market…

      I fear/expect it will come back if/when my S8 gets an Android update Oreo -> Pie, but I do not expect to get it back at the next security update (October) – but will of course keep an eye out for it!

      I have Disabled Google Maps (I use Navmii), but hesitate to uninstall, if I should regret, as I do not know a simple reinstall procedure… (other than factory reset)

      1. Ah, now I understand. It also means both partition sets should be fine since it’s more of a flag for the OS to not interact with those APKs.

        I think in this situation an OS upgrade, say from v8 to v9 should not bring them back. Should just respect that flag to not interact with “com.facebook.katana” apk. For me from Android 8 to 8.1 it kept all my settings, and it was the entire OS reflashed, 1.2GB or so. Time will tell exactly, I guess.

        1. Yeah sounds reasonable, but I would not be surprised if Samsung used the opportunity to ‘reenable’ their bloat that they do not allow people to get rid of cleanly (by uninstall or disable)…

        2. See the bottom “add” in the above, I forcibly uninstalled and unsuccessfully tried to reinstall an app present in the Market (the Samsung Gallery),

          Expect the Google Map to react the same way..

          1. I tried this too. There is only one application which Xiaomi added to this phone called Feedback or com.miui.bugreport.

            ADB shell pm uninstall -k โ€“user 0 com.miui.bugreport
            Success. Yaay!

            I then tried to install them back just to check:
            ADB shell pm install -r โ€“user 0 -i com.miui.bugreport /system/app/BugReport/BugReport.apk
            ADB shell pm install -r โ€“user 0 /system/app/BugReport/BugReport.apk

            Both these commands fail telling me the -u argument does not exist. I guess it took it from -user.

            ADB shell pm install -r -i com.miui.bugreport /system/app/BugReport/BugReport.apk
            ADB shell pm install -r /system/app/BugReport/BugReport.apk

            Success. Kind of?

            What they did was to just install the apk again as an update, without actually enabling it. It was still telling me the application is not available for this user in Settings, but now I had three dots in the upper right corner because those applications were considered “updated”. I clicked on those three dots then uninstalled the “update”. Restarts also did not bring them back in any situation.

            I also found something called “Spock” “com.miui.spock” which apparently is supposed to be used for debugging applications and telemetry purposes. I’m not a developer so I have no use for it, also disabled.

            Note: pasting these commands in CMD failed. Apparently it was pasting something along the lines “ADB shell pm uninstall -k 45 0” I don’t know where it was getting that “45”, so what I’ve done was enter “adb shell” then manually type all that “pm uninstall..” or “pm install..”.

          2. You need TWO minuses on the “–user 0” and what you got now is that it is installed for another user. ๐Ÿ™‚

            But very interesting that you ARE allowed to (re)install it, so not completely irreversible. ๐Ÿ™‚

          3. WordPress thinks that two typed minuses in visual (not just in text) shall be replaced with a longer dash…. That is what made your cut&paste fail I guess. I have added pre tags in the body above, so now it should be better….

            … And “telemetry purposes” sounds like: We are stealing your usage data and sending them home.

          4. Ah, I see now those first two commands to (re)install them back return:
            java.lang.IllegalArgumentException: Unknown option -4
            Still, nothing seems to be changed on the device.

            Ah, of course the main purpose of that application is to send everything back to its mothership >:( Considering how little I was able to find about it online.

          5. I think you have to install/uninstall with matching user, that is if the uninstall had a “–user 0” then the (re)install should too.

            On the error could you post the actual command that gives this? is looks more like a syntax error in the command, than the command failing on execute.

            Are you on Oreo by the way? I am, and Android re-did the “Unknown sources” thing, so that might be the root of the -3001 I get….

            In Oreo “Unknown sources” has been replaced by a Per App system. Intended to use a different store than Googles own (Read: China) see e.g. here

          6. Sure

            adb shell
            pm install -r -โ€“user 0 -i com.miui.bugreport /system/app/BugReport/BugReport.apk

            or

            adb shell
            pm install -r -โ€“user 0 /system/app/BugReport/BugReport.apk

            Typed one line at a time. Both return the same thing. Also both manually typed since it still pastes “45-user 0” instead of “–user 0”.

            Android 8.1 from 05.09.2018 and I ran everything as administrator from Windows 7.

          7. Wait, no, it worked, wtf o.O

            adb shell
            pm install -r -โ€“user 0 -i com.miui.bugreport /system/app/BugReport/BugReport.apk

            Brought back my Feedback application. No restart needed! The command returned Success ๐Ÿ™‚

          8. Yup, I brought back Spock as well:
            pm install -r --user 0 -i com.miui.spock /system/app/Spock/Spock.apk
            Using the same adb session.

          9. Interesting! So must be some Samsung limitation then.

            Did you enable something like “unknown sources” (apart from “USB Debugging” of course) ?

          10. No. Under Settings > Applications > Advanced > Special aplication access > Install unkown applications, even after I check to show system all applications are set to Not allowed apart from my file manager X-plore which I set it to Allowed. (yeah, Google really burried this setting so it’s not easy to find)

            The only “modification”, if you can call it this way, to this device is that I ran “fastboot oem unlock” so I can flash it from PC if/when needed, and now in my developer settings the option “OEM unlocking” is enabled and grayed out with the mention below “Bootloader is already unlocked”.

          11. Just found that the new “Install Unknown Apps” is (also) available from the Security menu, I’m quite certain that I looked for it there without finding it, so maybe it is hidden until you the first time open it the long way round!?! … I would not be surprised…

            And AH! could well be that the unlocked bootloader did something. It ought not to matter that you have given a filemanager the permission. That should not be in play via ADB shell. And it is not that just any app has the permission as I tried to add it to one, with no difference.

            It is also a bit odd that I can not find any description of what

                Failure [-3001]

            really means

          12. I noticed the edits on the page. I did force close and remove the data on both applications prior to remove them via Settings. I don’t believe this should break the reinstall function this badly though. Although Android kind of expects to have the data removed for every uninstalled application, as far as I can see it never leaves leftovers, save for some empty directories under “Android/data” folder sometimes.

          13. The little I found on 3001 googling indicates that manually clearing the data allows a previous install that failed with 3001 to run. So this i why I think that it MIGHT have worked if I had omitted the -k.switch

          14. I narrowed it down to these:

            Remove:
            adb shell
            pm uninstall --user 0 com.miui.bugreport

            Reinstall:
            adb shell
            pm install -r --user 0 /system/app/BugReport/BugReport.apk

            Run each line individually. If already in adb shell then omit the first line and just proceed with “pm uninstall..” or “pm install..” to switch between removed and installed state.

            I don’t know what the “-r” parameter does, but without it reinstallation fails.

          15. Weird, I don’t understand why it would fail for me without that -r in this case.

          16. Yes most likely it is.

            If would make sense that changing system apps and changing the bootloaders were related.

            Sure Android could have detected that it is actually a reinstall, but most likely no one thought of that as important. And I fear that they would rather see the option of logically ‘uninstalling’ as something they should change to require unlocked bootloader than to allow re-install without.

            So let us hope they do not plug this ‘hole’.

          17. BTW I too originally wrote the post with one common

            ADB shell

            BUT it has the huge disadvantage that you can not cut&paste more than one command at the time (I think it is something with LF/CR/CRLF that confuses the shell) so it might work from some editors/browser but not from others. (Fails copying from FireFox and pasting into a plain CMD)

    2. Note that I have updated the blog/entry, as it is possible to use “disable-user” (one word single dash) AND this is reversible ๐Ÿ™‚

      So If/when I do a factory reset again, I will just use that rather than “uninstall”.

      1. Applications disabled via that command show “disabled” or “not installed for this user”?

        1. Show where? on the normal apps view the initial ones I uninstalled says “Not installed”. Both the ones I gave disable-user and the ones i have disabled in the UI shows “disabled”. (But only the later ones [ADD:] plus some of the others [/ADD] I can enable from the UI)

          1. Yes, in settings I was wondering. I was also wondering if you could re-enable them directly in settings but you gave me the answer already ๐Ÿ™‚ Well, it’s good it works as expected.

          2. ….And a bit confusing that there are all kind of combinations between Enabled/disabled , Installed/Not installed and running/stopped.
            I have even seen one that is marked “Not installed”, where I in the UI could press “Force stop”. And the strange thing is that it is an app I have no recollection of having uninstalled….

            The “BBC Agent” aka “KnoxBBCProvider” with package com.samsung.android.bbc.bbcagent (And Im pretty sure that it is not that BBC we are talking about)

          3. Regarding this confusion, some applicstions can have multiple smaller “instances” in which they can be invoked.

            For instance Open Camera has a the main instance, Camera but also can act as a gallery. If I long-press on it I get the option to open its gallery. In Nova Launher I can even create it as a shortcut.

            Some other applications can even spawn two different icons in launcher (rarely, I can’t rememeber which did this).

            And some applications can be tied together, for instance Microsoft’s Excel/Word/PowerPoint – if I disable background data transfer for one, it gets disabled for the other as well. Same with permissions.

            I assume the same could the case if you disable an application which is tied to other applications. Though I don’t think it’s necessary, my “Feedback” application which I disabled was shown in Settings to be tied to 20+ other system applications, including something related to the fingerprint sensor, though nothig else got unistalled other than what I specified.

          4. Yeah, I think this is an Android 7+ “feature”. I don’t remember ever seeing this before.

          5. …and to confuse further packages can also be HIDDEN

            if you execute
            adb shell pm list packages -u

            and compare with
            adb shell pm list packages

            The first will include BOTH those that are uninstalled and those that are hidden.

            The ones in this difference between the two that does NOT appear as “Not installed” in the apps list (incl system) are the hidden ones (Easy, right….)

            On the S8 that is

            package:com.sec.knox.bluetooth
            package:com.samsung.android.bbc.fileprovider
            package:com.sec.enterprise.knox.shareddevice.keyguard

          6. I assume applications which are usually invoked from other places like bluetooth woukd be hidden. Would make little sense to open the bluetooth on its own from launcher. At best you’d get a bluetooth-related settings page.

          7. I’m a bit tired, now I see ๐Ÿ™‚
            I ran those two commands, here the only two applications which the -u parameter shows over the one without are the two which I disabled
            com.miui.bugreport
            com.miui.spock

    1. Thanks!
      Indeed I am allowed to do e.g.
      adb shell cmd package install-existing com.samsung.android.widgetapp.yahooedge.sport

      Though for some reason It does not seem to reenable it completely. That is, it appears as installed from both the PC and phone side, but there are no icon/widget for it. I tried to restart the phone, that did not do the trick.

      Any good ideas?

      ADD:
      It works fine on gallery
      ADB shell pm uninstall -k --user 0 com.sec.android.gallery3d

      ADB shell cmd package install-existing com.sec.android.gallery3d

      (Uninstalling removes icon, and reinstall restores it)

      1. I’m not certain why it doesn’t work on that yahoo app. Maybe it has another dependency? I was able to reinstall Samsung Experience Home (heads up, it’s required on Pie for the new app switcher/multi window) for my user using that command and that is the only app I have tested it on.

        I came across this blog post when I was searching how to re-enable apps on my S8 which I had “disabled” using the same technique you had used. Eventually a commenter on reddit showed me that command. What’s so strange is when I search that command I can’t find any solid documentation on why it seems to work as opposed to other methods you and I have tried. In fact, all I could find were people suggesting the command when posed the question we were both asking. Admittedly I didn’t search for very long, but it is disappointing the lack of easily searchable documentation that ADB and the ADB Shell has.

        1. Thanks for the details. It is a bit odd that the documentation is quite lacking.
          My worst fear is that as more people learn to kill all the junk, Google will ‘plug’ the hole and disallow it on unrooted devices. It could easily be argued that it is a hole that we are allowed to do stuff this way that would normally require rooting…

      2. Be aware that this command doesn’t work for Android versions older than Android Oreo (8.0).

          1. This is what I was hoping for but there is unfortunately no equivalent ADB command ๐Ÿ™

            I guess it’s safer to use pm disable-user $package && am force-stop $package && pm clear $package instead of pm uninstall $package.

            This lets you use pm enable $package in case of problem.

            I developed and try to maintain a universal tool which remove bloatwares on any unrooted Android phones. I’ve just encounter this problem today with an old phone.

            If my project interest someone :

            PS : You should try Commento instead of the slow and privacy-invasing Disqus for your comment section ๐Ÿ™‚

          2. I think the disable syntax is different on older androids too, and the options on uninstall might be different too.

            You got yourself a hard job with a generic tool I guess. The documentation I found searching was of very varying quality, and it was not always very clear what version it was intended for. You might consider some feedback mechanism so people can report back to a database, on what has odd side effect if removed, and what is clear cut functionality removed with no side effects. I did quite a bit of Trial&Error. It could help many users if you could colour the apps green/orange/red (Safe / Side effects / Vital)

            Also note the oddity that some apps do not uniinstall/reinstall cleanly, and that sometimes OTA updates re-enables some of the bloat the user had disabled. And packages can get new names on updates (see the Pie-related thread linked)

          3. Arg ! Sorry my bad english, I’m not a native speaker and I should have reread myself.

          4. Actually, my post above refers to another comment I made but which seems to be considered as a spam (because I put links in it I guess).

          5. (Yeah I’m a bit lazy, not surveying the comments too often, so selected to have anything with a link, go directly in the ‘pending’ box for moderation)

  2. Thank you very much for great and informative post! I removed sticker* packages and my camera was crashing all the time as described. Reinstalling (install-existing) did the trick!

      1. In my case it was just about reverting packages:

        โžœ ~ adb shell cmd package install-existing com.samsung.android.provider.stickerprovider
        Package com.samsung.android.provider.stickerprovider installed for user: 0
        โžœ ~ adb shell cmd package install-existing com.samsung.android.stickercenter
        Package com.samsung.android.stickercenter installed for user: 0
        โžœ ~ adb shell cmd package install-existing com.samsung.android.app.camera.sticker.facear.preload
        Package com.samsung.android.app.camera.sticker.facear.preload installed for user: 0
        โžœ ~ adb shell cmd package install-existing com.samsung.android.app.camera.sticker.stamp.preload
        Package com.samsung.android.app.camera.sticker.stamp.preload installed for user: 0

        But you’re right, disable seems safer.

Leave a Reply

Your email address will not be published. Required fields are marked *