[Q]Can I uninstall an app via adb? - Android Q&A, Help & Troubleshooting

Is there a command/parameter that I can use to uninstall an app from the emulator or even a device?
I have gone through settings and I also blanked out the emulator session, but both are very time consuming. I thought maybe there was an easier way. Any suggestions?
Thanks...
Sent from my SAMSUNG-SGH-I897 using XDA App

adb remove (full app filename, no extension) eg adb remove com.developer.appname
or adb shell rm /data/app/(full app filename with apk extension)
to find the file name, use adb shell ls /data/app/

Thanks, I'll give it a try. I find it interesting though that the docs don't have the remove command. Also, I found an adb wiki that also does not have the remove command but does have an uninstall command. Why the differences? Oh well, even though I did not see it in the docs I should have at least tried the uninstall for grins before I posted. It is late so I will try both tomorrow.
Thanks again.
Sent from my...

Device Admin
Hello,
This uninstall parameter is being fail to remove app which is privileged as Device Admin.
How to deactivate Device Admin Privilege on any app thru adb ?
How to uninstall Device Admin App thru ADB ?

Related

[Q]ADB issue

Okay, so I'm a bit an ADB noob here. I've been trying to push my avatar apk into /system/apps for awhile here but every time i do so, it fails with this error:
/bin/sh: adb: not found
did I set it up wrong somehow?
Oniyuri said:
Okay, so I'm a bit an ADB noob here. I've been trying to push my avatar apk into /system/apps for awhile here but every time i do so, it fails with this error:
/bin/sh: adb: not found
did I set it up wrong somehow?
Click to expand...
Click to collapse
Make sure you are running the adb command from the directory where your adb is located. There is tons of info on this site and google that will give you everything you need to know about using adb. Try typing the error message into search
yeah, i know to change directories already. this error is happening after i'm in the directory.
i basically start out like this:
cd C:\android-sdk-windows\tools
and after that, switch to adb shell
C:\android-sdk-windows\tools> adb shell
i get some characters and then try for a push
"adb push C:\users\myuser\downloads/avatar.apk /system/app
after that, boom! error.
bump
+10char
Oniyuri said:
yeah, i know to change directories already. this error is happening after i'm in the directory.
i basically start out like this:
cd C:\android-sdk-windows\tools
and after that, switch to adb shell
C:\android-sdk-windows\tools> adb shell
i get some characters and then try for a push
"adb push C:\users\myuser\downloads/avatar.apk /system/app
after that, boom! error.
Click to expand...
Click to collapse
You really should be using either the search bar here or google because this information is in abundance. "adb push" should not be run from inside the shell. adb is not recognized by the shell. Do the same thing that you listed above minus the step where you typed "adb shell"
********
Sent from my Paragon RC3 Captivate using the XDA app
Try 'cd C:\android-sdk-windows\platform-tools', not C:\android-sdk-windows\tools.
Better yet, just add that to the environment variable, PATH.
hth

Why can't fre3vo be run with a script using script manager?

Since we now have more than one solution that provides full root access between reboots, I figured I'd try writing a shell script to run fre3vo. I can... and it runs... but I get the message "this device is not supported by this exploit".
So why does it run from ADB and not a script? Does the phone have more rights/access when connected via ADB? If the script would work, we could write one that could run after every reboot (using script manager) and it'd be a permanent solution.
Mike
I am trying the same thing with the easyfre3vo package...Setting the root.redo.bat to 'run as root', and executing just seems to hang...
Any ideas?
Sent from my PG86100 using XDA App
What about that app "gscript lite", or " adb wireless"?
Sent from my 3rd Dimension of Evolution
ADB has different permissions compared to a terminal on the phone. A terminal emulator on the phone and/or a tool like Gscript doesn't have the ability to do anything in the /data/local/tmp directory like ADB does.
ADB over wifi needs root, so you can't use it to run fre3vo since you don't have root - you can use it AFTER you've run fre3vo though.

How do I uninstall an APK?

So I used ADB install to install got248, but now I've installed a better 2048 clone for android wear from the play store, so I how do I uninstall the old APK?
Uclydde said:
So I used ADB install to install got248, but now I've installed a better 2048 clone for android wear from the play store, so I how do I uninstall the old APK?
Click to expand...
Click to collapse
I am wondering the same thing bc literally I did the same thing as you with 2048 haha. I'm guessing you could try this command: adb uninstall got2048.apk
Uclydde said:
So I used ADB install to install got248, but now I've installed a better 2048 clone for android wear from the play store, so I how do I uninstall the old APK?
Click to expand...
Click to collapse
In order to uninstall the application you need to know it's package name (ie com.someapp.app) then use the following adb command to uninstall, adb uninstall com.someapp.app.
If you are not sure what the package name is then you can run the following adb commands in order to get a list of apps installed:
adb shell
su
cd /data/app
ls
This should give you a list of apps on the watch/ Hope this helps.

question about adb shell vs terminal on device.

hi,
quick question..
i put "setprop service.adb.tcp.port 5555" in file.txt, and save this to /sdcard.
if i run "sh /sdcard/file.txt" from adb shell, on pc, then it works and getprop confirms.
if i run "sh /sdcard/file.txt" from terminal emulator, on phone, it says "could not set property".
can someone explain this behaviour? tahnk you.
in addition, where should you save shell scripts on your phone?
do you guys use shell scripts? can you give examples of what you use them for?
MrPresident said:
hi,
quick question..
i put "setprop service.adb.tcp.port 5555" in file.txt, and save this to /sdcard.
if i run "sh /sdcard/file.txt" from adb shell, on pc, then it works and getprop confirms.
if i run "sh /sdcard/file.txt" from terminal emulator, on phone, it says "could not set property".
can someone explain this behaviour? tahnk you.
in addition, where should you save shell scripts on your phone?
do you guys use shell scripts? can you give examples of what you use them for?
Click to expand...
Click to collapse
Try "su" command first and grant root access to terminal app
minimale_ldz said:
Try "su" command first and grant root access to terminal app
Click to expand...
Click to collapse
thanks for the reply, minimale.
okay. so, as you suggested, it works when i do it as root from the terminal app.
but couple of things.
1) Why can i run it from adbshell without 'su' command. through adb shell it still works as "[email protected]:/ $" instead of "[email protected]:/ #"
2) how come, without 'su', I can access "/sdcard" (as "[email protected]: / $"). but, as root, I have to go through "/data/media/0"
MrPresident said:
thanks for the reply, minimale.
okay. so, as you suggested, it works when i do it as root from the terminal app.
but couple of things.
1) Why can i run it from adbshell without 'su' command. through adb shell it still works as "[email protected]:/ $" instead of "[email protected]:/ #"
2) how come, without 'su', I can access "/sdcard" (as "[email protected]: / $"). but, as root, I have to go through "/data/media/0"
Click to expand...
Click to collapse
I'm glad I helped, but have no idea where the differences between ADB and terminal emulator come from. It's beyond my current knowledge.
minimale_ldz said:
I'm glad I helped, but have no idea where the differences between ADB and terminal emulator come from. It's beyond my current knowledge.
Click to expand...
Click to collapse
no worries. i got what i need.

[MOTO G8+] "You cannot install this app because another user..."

Hi,
I want to reinstall a Motorola firmware app.
I uninstalled the firmware a year ago on my Moto G8+ with adb using the following command:
"pm uninstall -k --user 0 com.motorola.faceunlock"
Now when I want to install the app from the Play Store I can't. I get the following error message:
"You cannot install this app because another user has already installed an incompatible version on this device."
Click to expand...
Click to collapse
I already tried a few things I found in other threads and forums but nothing really worked. I'm a single user, however the guest function allows me to find the Moto face unlock App as an installed app. In settings I can't find any option that allows me to "uninstall the app for all users" or to "reinstall" or "restore" it. Factory Reset is not an option for me.
I was thinking about maybe reinstalling the package via adb for the main user again, if that's possible? I only have little knowledge about adb.
Has somebody an idea or command I could try out?
Thanks in advance
@sokrvtxs
The ADB command you used removed the the mentioned system-app ( leaving its data untouched ) only for user 0, that's the current user, what means that the deleted app still remains available for other users of the Android device - it didn't get removed from device's storage space at all. That's basically a good thing because you can easily restore an app if you uninstall it by mistake or need it later.
This brings the system-app back:
Code:
adb devices
adb shell "cmd package install-existing com.motorola.faceunlock"
adb reboot
If your Android is rooted then you can update the system-app in question
Code:
adb devices
adb push <PATH_TO_UPDATE_APK> /data/local/temp
adb shell "pm install -r /data/local/tmp/<UPDATE_APK>"
adb shell "rm /data/local/tmp/<UPDATE_APK>"
adb reboot
Thank you so much, my phone is not rooted. The first code worked and my issue is solved completely. This helped me a lot.

Categories

Resources