adb shell pm enable does not persist after reboot - General Questions and Answers

I accidentally copied the wrong command and used adb shell pm disable-user --user 0 $app instead of adb shell pm uninstall --user 0 $app
I can uninstall / install-existing it just fine but for some reason using enable doesn't work.
When I do adb shell pm enable $app I get an error message, when I use su it works, and when I first unfreeze it with sdmaid and then use the enable command it works too, however it is back to being disabled again after reboot.
I also tried adb shell pm default-state --user 0 $app with the same result.
It works just fine with other apps, but they are typically either disabled or uninstalled.
Now "com.android.sdm.plugins.connmo", "com.android.sdm.plugins.dcmo" and "com.android.sdm.plugins.diagmon" are both disabled and uninstalled.
I somehow was able to reinstall them and have that persist after reboot but they were still disabled after that.

Always get correct user id of user who should get prevented to run an app
Code:
adb shell "pm list users"
before running shell command like this
Code:
adb shell "pm disable --user <USER-ID> <PKG-NAME>"
and this using the same user id
Code:
adb shell "pm enable --user <USER-ID> <PKG-NAME>"
instead of stupidly using user id 0

What's the matter with just: pm disable com.annoying.app ?

The --user <USER-ID> parameter is usually needed on newer Android versions to specify which user ID the pm utility needs to apply the changes to.

jwoegerbauer said:
Always get correct user id of user who should get prevented to run an app
Code:
adb shell "pm list users"
before running shell command like this
Code:
adb shell "pm disable --user <USER-ID> <PKG-NAME>"
and this using the same user id
Code:
adb shell "pm enable --user <USER-ID> <PKG-NAME>"
instead of stupidly using user id 0
Click to expand...
Click to collapse
UserInfo{0:Owner:c13} running
My user ID is 0
would be great if it would work like that except it doesn't for whatever reason.
Is there a difference using "disable-user --user <USER-ID> <PKG-NAME>" vs "disable --user <USER-ID> <PKG-NAME>"?
I mean thats not rly my problem as I wanna *enable* it again, but yea..
running either enable or disable command in non elevated shell results in
java.lang.SecurityException: Shell cannot change component state for null to 1
which is weird as it does work for literally any other app.
using elevated shell it works, however it resets back to disabled state on reboot, which is even weirder given that the default state of this package would be enabled=1
and I should note that it mustve worked before as well, as it was originally enabled and I slipped in the wrong line and accidentally copied the command to disable apps instead of what I wanted to do.
And for some reasom that worked..
specifically the command I used was adb shell pm disable-user --user 0 com.android.sdm.plugins.connmo and it works for any other app to disable it and i can enable them right back.

Related

[Guide] Write a batch script + ADB/Fastboot commands

Write a batch script with ADB and Fastboot commands​
1. Introduction:
Hi guys,
First of all, I've some words to say:
I've decided to make a tutorial for beginners how to write a windows batch file with ADB and Fastboot commands. I think it's quite easy and everybody can learn it.
My target is, that all of you can write your own batch files to control your device.
You don't need any knowledges about batch files or similar things. It's just helpful to know the adb commands and how they work.
I hope you'll understand every step, I make. The guide is splitted in several parts.
If you want, I'll add some more tips and tricks.
2. Requirements:
Windows Computer
Notepad++
ADB Tools
Just search on the internet for those files. They are easy to find.
Create a folder and place your adb/fastboot files in it. Make sure that they are working
Install Notepad++ on any place on your computer
Open Notepad++ and create a new file
Go to Languages -> Batch and activate it
Save the file as batch file in your adb folder
Well, I think now we can start with the main commands.
3. Main batch commands:
In this section, I'll explain you important main commands for your batch file.
Don't enter the quotationmarks in your file.
"@echo off" - Is always at the beginning of your file. This command blocks the output of your command in the cmd
"echo TEXT" - Here you enter "echo" and your text at the beginning of the line. This text appears in the cmd. E.g. : "echo Hello this is my first file"
"echo." - Will create a blank line
"pause" - Will create a pause in your file. The file continues by pressing any key. A message for that appears in the cmd
"pause>nul" - Has the same function like "pause" but you won't get the output in the cmd, that you need to press any key to continue
":TEXT" - Creates a certain section in your script
"goto TEXT" - This command brings you to the section "TEXT" in your code. "TEXT" can e.g. include any certain command, you want to execute
Declaration of variables:
Now I'll show you, how to declare a variable
"set test= Hello XDA-Members"
The variable "test" includes the string "Hello XDA-Members"
To access this variable, you need to enter %test%
"set /p input= Enter your variable:"
Here, the user needs to enter something in the cmd. This input will be saved in the variable "input".
To access this variable, you need to enter %input%
You can select the variable name as you want.
Now we have already some commands, so let's try them out.
In my example, I'll add comments to the commands, which are written in blue. Please don't add them to yours.
The second "@echo off" is not necessary
So, now we save the file and run it with a double-click.
Your script should look like this:
(Not everything is in mine included)
Making a selection menu:
Now, we make a selection meu where the user has several options
Step by step:
Create a list with "echo" commands
Create an input variable
Create an if statement
Let's take a look at my example code.
You should already understand the old commands.
As you can see, this is still quite simple
If everything worked right, you should see this
Well, for the beginning that's enough. For the next step, you should know all these commands and how they work.
4. Including ADB/Fastboot commands:
Okay, now we'll start to add ADB and Fastboot commands to our batch file for controling our device with our tool.
The previous steps are the base for the following commands
First of all, we start with a quite easy command.
We want a batch file, which reboot our phone into Recovery,Bootloader or normal.
Now we need the adb files in our folder
Step by step:
Create a selection menu
Include the ADB/Fastboot commands
Let's take a look at my example code.
Our Reboot-Tool should look like this
These commands are still easy. You just need to enter your adb command
E.g.: adb.exe reboot recovery
Now we'll execute our file
You can see, that this tool is already very useful.
So, Congratulation to everybody who came so far
Are you ready for the next step? Let's go!
5. Including advanced ADB/Fastboot commands:
Okay, now we will add some more difficult commands to our script.
You need to know the old commands and how the work
Step by step:
Reboot device in different modes
Flash a custom recovery
Do a Factory Reset
Install Apps
Ok, let's take again a look at our example code
I won't explain the old commands, only the new ones.
Take your time and read it slowly.
The script is splitted in two pictures, so read both.
As you can see, we have now some more difficult codes, which include flashing Recoverys with certain file names.
Again, Congratulation who came so far.
6. Additional Commands:
- SOON -
7. Hints:
Now we are almost done with our first batch script.
At the end I have some more useful hints for you
Have always a clear structure
Take your time, it may not work for the first time
Read some other Batch-Guides on the internet
Just discover the batch coding and learn new commands, you can add to your script.
There are a lot of posibilities.
You can download the last script and the pictures from my dropbox:
https://www.dropbox.com/sh/jfogzlnj4df90uf/AABwRajM0piQHi5MnuEmzON5a?dl=0
Moreover check out my Universal_ADB-Helper, which is based on this:
http://forum.xda-developers.com/android/software/utility-universaladb-helper-1-0-t2969165
8. Last words:
Now we are done with our batch script. I hope you enjoyed my tutorial and that it was easy to understand for beginners.
Moreover I want to say thank you at RootJunky who inspired me to start with batch scripting.
Check out this video from him:
https://www.youtube.com/watch?v=8q3y9zkEeHM
and his website:
http://www.rootjunky.com/
Reserved for later
Additional commands will be added soon.
Nice!
Hey! Nice tut! BTW a little late
HERE's why
MZ_. said:
Hey! Nice tut! BTW a little late
HERE's why
Click to expand...
Click to collapse
Hi,
Thanks
I think the difference between our threads is that mine is a tutorial how do code such a tool and yours is the finished tool.
Some time ago, I've done something similar:
http://forum.xda-developers.com/android/software/utility-universaladb-helper-1-0-t2969165
Very Very DOPE! Im wondering if you can help me with something. I have taken your script to automate alot of my processes. Could you possibly help me with this problem im having?!?! Thank you in advanced!
Code:
:installA
cls
echo.
echo You will install an app
echo The app need to be in your ADB-Folder
echo Before you hit enter INSTALL "iKoNo"" on your FireTV
echo.
pause
echo.
echo You can find your IP by going to Settings > About > Network on your device
set /p ip=Enter the IP of your FireTV or FireTVStick:
adb kill-server
adb connect %ip%
adb install "C:\Users\demo\Desktop\FireTV\kodi.apk"
adb install "C:\Users\demo\Desktop\FireTV\settings.apk"
adb install "C:\Users\demo\Desktop\FireTV\llama.apk"
[CODE]Ok here I want some code to go where you can check and verify the top three were installed and if not stop the script i guess using
adb shell pm list packages <- just dont know the proper way of doing it. And does the syntax below look right? Im trying to mimic the functions that adbfire does to automate the LLAMA install. Posted below
adb push "C:\Users\demo\Desktop\FireTV\busybox" /data/local/tmp/
adb shell chmod 755 /data/local/tmp/busybox
adb shell "C:\Users\demo\Desktop\FireTV\busybox" --install -s /data/local/tmp
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko" /sdcard/Llama/
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Profiles.txt" -> /sdcard/Llama/Llama_Profiles.txt
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_NfcNames.txt" -> /sdcard/Llama/Llama_NfcNames.txt
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_IgnoredCells.txt" -> /sdcard/Llama/Llama_IgnoredCells.txt
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Events.txt" -> /sdcard/Llama/Llama_Events.txt
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Areas.txt" -> /sdcard/Llama/Llama_Areas.txt
adb shell rm -r /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb shell mkdir -p /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\icons\ikokodi.icon" /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\icons\ikokodi.icon\B00NEJS7ZO\thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png" -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png
adb push "C:\Users\demo\Desktop\FireTV\adbfw128\icons\icons\ikokodi.icon\B00NEJS7ZO\preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png" -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png
adb kill-server
echo.
echo Done!
exit
pause>nul
cls
goto menu
[/CODE]
Llama's logs:
Code:
adbFire v1.28
073115131544
Windows
------------
"./adb.exe" kill-server
server stopped
server started
"./adb.exe" start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
starting server
initial open
192.168.137.174
"./adb.exe" kill-server
server stopped
server started
"./adb.exe" start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connection attempt
"./adb.exe" connect 192.168.137.174:5555
connected to 192.168.137.174:5555
"./adb.exe" push ./busybox /data/local/tmp/
503 KB/s (1356524 bytes in 2.632s)
"./adb.exe" shell chmod 755 /data/local/tmp/busybox
"./adb.exe" shell /data/local/tmp/busybox --install -s /data/local/tmp
process time duration: 9 seconds
llama options function entered
com.kebab.Llama not found
"./adb.exe" shell pm list packages
opening Llama dialog
org.xbmc.kodi is installed
"./adb.exe" shell pm list packages
org.ikonotv.smarttv is installed
"./adb.exe" shell pm list packages
"./adb.exe" shell rm -r /sdcard/Llama
rm failed for /sdcard/Llama, No such file or directory
"./adb.exe" push .//events/llamakodi/linkiko /sdcard/Llama/
push: .//events/llamakodi/linkiko/Llama_Profiles.txt -> /sdcard/Llama/Llama_Profiles.txt
push: .//events/llamakodi/linkiko/Llama_NfcNames.txt -> /sdcard/Llama/Llama_NfcNames.txt
push: .//events/llamakodi/linkiko/Llama_IgnoredCells.txt -> /sdcard/Llama/Llama_IgnoredCells.txt
push: .//events/llamakodi/linkiko/Llama_Events.txt -> /sdcard/Llama/Llama_Events.txt
push: .//events/llamakodi/linkiko/Llama_Areas.txt -> /sdcard/Llama/Llama_Areas.txt
5 files pushed. 0 files skipped.
10 KB/s (501 bytes in 0.047s)
"./adb.exe" shell rm -r /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
"./adb.exe" shell mkdir -p /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
"./adb.exe" push ./icons/ikokodi.icon /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
push: ./icons/ikokodi.icon/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png
push: ./icons/ikokodi.icon/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png
2 files pushed. 0 files skipped.
696 KB/s (94838 bytes in 0.133s)
exit llama function
process time duration: 75 seconds
closing program
"./adb.exe" kill-server
server stopped
---------- Post added at 07:31 PM ---------- Previous post was at 07:10 PM ----------
Code:
You will install an app
The app need to be in your ADB-Folder
Before you hit enter INSTALL "iKoNo"" on your FireTV
Press any key to continue . . .
Enter the IP of your FireTV or FireTVStick:213
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 192.168.137.213:5555
383 KB/s (60646715 bytes in 154.478s)
pkg: /data/local/tmp/kodi.apk
Success
375 KB/s (3269290 bytes in 8.500s)
pkg: /data/local/tmp/settings.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
367 KB/s (2783570 bytes in 7.397s)
pkg: /data/local/tmp/llama.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
376 KB/s (1356524 bytes in 3.514s)
/system/bin/sh: C:UsersdemoDesktopFireTVbusybox: not found
push: C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko/Llama_Profiles.txt -> /sdcard/Llama/Llama_Profiles.txt
push: C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko/Llama_NfcNames.txt -> /sdcard/Llama/Llama_NfcNames.txt
push: C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko/Llama_IgnoredCells.txt -> /sdcard/Llama/Llama_IgnoredCells.txt
push: C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko/Llama_Events.txt -> /sdcard/Llama/Llama_Events.txt
push: C:\Users\demo\Desktop\FireTV\adbfw128\events\llamakodi\linkiko/Llama_Areas.txt -> /sdcard/Llama/Llama_Areas.txt
5 files pushed. 0 files skipped.
4 KB/s (501 bytes in 0.117s)
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
push: C:\Users\demo\Desktop\FireTV\adbfw128\icons\ikokodi.icon/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png
push: C:\Users\demo\Desktop\FireTV\adbfw128\icons\ikokodi.icon/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png
2 files pushed. 0 files skipped.
296 KB/s (94838 bytes in 0.312s)
The system cannot find the path specified.
The system cannot find the path specified.
Done!
Sorry but at the moment I've no idea.
Thanks for the response though lol
Hi,
Can you see what is the problem for my script? Fastboot devices doesn't appear...
spicediablo said:
Hi,
Can you see what is the problem for my script? Fastboot devices doesn't appear...
Click to expand...
Click to collapse
Why do you switch into another directory?
Place your batch and adb/fastboot files in the same folder.
Then try the following:
Code:
fastboot.exe
fastboot.exe devices
pause
Otherwise you can try to use yours but use "fastboot.exe" instead of "fastboot". Hope it helps.
Lars124 said:
Write a batch script with ADB and Fastboot commands​
1. Introduction:
Hi guys,
First of all, I've some words to say:
I've decided to make a tutorial for beginners how to write a windows batch file with ADB and Fastboot commands. I think it's quite easy and everybody can learn it.
My target is, that all of you can write your own batch files to control your device.
You don't need any knowledges about batch files or similar things. It's just helpful to know the adb commands and how they work.
I hope you'll understand every step, I make. The guide is splitted in several parts.
If you want, I'll add some more tips and tricks.
2. Requirements:
Windows Computer
Notepad++
ADB Tools
Just search on the internet for those files. They are easy to find.
Create a folder and place your adb/fastboot files in it. Make sure that they are working
Install Notepad++ on any place on your computer
Open Notepad++ and create a new file
Go to Languages -> Batch and activate it
Save the file as batch file in your adb folder
Well, I think now we can start with the main commands.
3. Main batch commands:
In this section, I'll explain you important main commands for your batch file.
Don't enter the quotationmarks in your file.
"@echo off" - Is always at the beginning of your file. This command blocks the output of your command in the cmd
"echo TEXT" - Here you enter "echo" and your text at the beginning of the line. This text appears in the cmd. E.g. : "echo Hello this is my first file"
"echo." - Will create a blank line
"pause" - Will create a pause in your file. The file continues by pressing any key. A message for that appears in the cmd
"pause>nul" - Has the same function like "pause" but you won't get the output in the cmd, that you need to press any key to continue
":TEXT" - Creates a certain section in your script
"goto TEXT" - This command brings you to the section "TEXT" in your code. "TEXT" can e.g. include any certain command, you want to execute
Declaration of variables:
Now I'll show you, how to declare a variable
"set test= Hello XDA-Members"
The variable "test" includes the string "Hello XDA-Members"
To access this variable, you need to enter %test%
"set /p input= Enter your variable:"
Here, the user needs to enter something in the cmd. This input will be saved in the variable "input".
To access this variable, you need to enter %input%
You can select the variable name as you want.
Now we have already some commands, so let's try them out.
In my example, I'll add comments to the commands, which are written in blue. Please don't add them to yours.
The second "@echo off" is not necessary
So, now we save the file and run it with a double-click.
Your script should look like this:
(Not everything is in mine included)
Making a selection menu:
Now, we make a selection meu where the user has several options
Step by step:
Create a list with "echo" commands
Create an input variable
Create an if statement
Let's take a look at my example code.
You should already understand the old commands.
As you can see, this is still quite simple
If everything worked right, you should see this
Well, for the beginning that's enough. For the next step, you should know all these commands and how they work.
4. Including ADB/Fastboot commands:
Okay, now we'll start to add ADB and Fastboot commands to our batch file for controling our device with our tool.
The previous steps are the base for the following commands
First of all, we start with a quite easy command.
We want a batch file, which reboot our phone into Recovery,Bootloader or normal.
Now we need the adb files in our folder
Step by step:
Create a selection menu
Include the ADB/Fastboot commands
Let's take a look at my example code.
Our Reboot-Tool should look like this
These commands are still easy. You just need to enter your adb command
E.g.: adb.exe reboot recovery
Now we'll execute our file
You can see, that this tool is already very useful.
So, Congratulation to everybody who came so far
Are you ready for the next step? Let's go!
5. Including advanced ADB/Fastboot commands:
Okay, now we will add some more difficult commands to our script.
You need to know the old commands and how the work
Step by step:
Reboot device in different modes
Flash a custom recovery
Do a Factory Reset
Install Apps
Ok, let's take again a look at our example code
I won't explain the old commands, only the new ones.
Take your time and read it slowly.
The script is splitted in two pictures, so read both.
As you can see, we have now some more difficult codes, which include flashing Recoverys with certain file names.
Again, Congratulation who came so far.
6. Additional Commands:
- SOON -
7. Hints:
Now we are almost done with our first batch script.
At the end I have some more useful hints for you
Have always a clear structure
Take your time, it may not work for the first time
Read some other Batch-Guides on the internet
Just discover the batch coding and learn new commands, you can add to your script.
There are a lot of posibilities.
You can download the last script and the pictures from my dropbox:
https://www.dropbox.com/sh/jfogzlnj4df90uf/AABwRajM0piQHi5MnuEmzON5a?dl=0
Moreover check out my Universal_ADB-Helper, which is based on this:
http://forum.xda-developers.com/android/software/utility-universaladb-helper-1-0-t2969165
8. Last words:
Now we are done with our batch script. I hope you enjoyed my tutorial and that it was easy to understand for beginners.
Moreover I want to say thank you at RootJunky who inspired me to start with batch scripting.
Check out this video from him:
https://www.youtube.com/watch?v=8q3y9zkEeHM
and his website:
http://www.rootjunky.com/
Click to expand...
Click to collapse
Wow ty so much for much needed help!!!! Having a fused problem with my m8 and its kernal, and its driving me madddd!!!
Power user said:
Wow ty so much for much needed help!!!! Having a fused problem with my m8 and its kernal, and its driving me madddd!!!
Click to expand...
Click to collapse
I think here's not the right place for Kernel or Rom problems.
Lars124 said:
I think here's not the right place for Kernel or Rom problems.
Click to expand...
Click to collapse
Every bit helps. So many different commands and options. Guess after a while after reading and trying so many different things better to take a step back and regroup lol. Thanks anyways got the mind distracted for a bit.
How I created my batch file to run commands in windows, for Minimal ADB and Fastboot
LG V30 Just factory defaulted.
Here is a snipit of the text I used to create my windows batch file for Minimal ADB and Fastboot, to give app freezer by MobizSystems, owner permissions and then to disable 1 program I can't uninstall, and then to uninstall a bunch of programs from the current user.
This batch file is run AFTER installing app freezer, then uninstalling my google account (can't apply owner permissions if there is an account installed). The pauses are to allow me to to verify each different command ran properly, and to terminate the program if a command is not running properly.
This is NOT meant to be a complete list of programs to uninstall, just a small list to show you how the batch file worked for me.
CD C:\Program Files (x86)\Minimal ADB and Fastboot\
adb devices
pause
adb shell dpm set-device-owner com.wakasoftware.appfreezer/.receiver.DPMReceiver
Pause
adb shell pm disable-user --user0 com.android.calendar
pause
adb shell pm uninstall -k --user 0 com.android.bips
pause
adb shell pm uninstall -k --user 0 com.android.egg
adb shell pm uninstall -k --user 0 com.android.mms
adb shell pm uninstall -k --user 0 com.android.printspooler
adb shell pm uninstall -k --user 0 com.android.settingsaccessibility
adb shell pm uninstall -k --user 0 com.android.vpndialogs
adb shell pm uninstall -k --user 0 com.facebook.system
adb shell pm uninstall -k --user 0 com.google.android.feedback
adb shell pm uninstall -k --user 0 com.google.android.marvin.talkback
adb shell pm uninstall -k --user 0 com.google.android.printservice.recommendation
adb shell pm uninstall -k --user 0 com.google.android.apps.cloudprint
adb shell pm uninstall -k --user 0 com.ipsec.vpnclient
adb shell pm uninstall -k --user 0 com.ipsec.profile
adb shell pm uninstall -k --user 0 com.ipsec.service
adb shell pm uninstall -k --user 0 com.lge.clock
adb shell pm uninstall -k --user 0 com.lge.cloudhub
adb shell pm uninstall -k --user 0 com.lge.easyhome
adb shell pm uninstall -k --user 0 com.lge.exchange
adb shell pm uninstall -k --user 0 com.lge.floatingbar
adb shell pm uninstall -k --user 0 com.lge.fmradio
adb shell pm uninstall -k --user 0 com.lge.gallery.aodimagewidget
adb shell pm uninstall -k --user 0 com.lge.gallery.collagewallpaper
adb shell pm uninstall -k --user 0 com.lge.gametuner
adb shell pm uninstall -k --user 0 com.lge.gestureanswering
adb shell pm uninstall -k --user 0 com.lge.jansky.service
adb shell pm uninstall -k --user 0 com.lge.jansky.settings
adb shell pm uninstall -k --user 0 com.lge.lgaccount
adb shell pm uninstall -k --user 0 com.lge.provider.signboard
adb shell pm uninstall -k --user 0 com.lge.qhelp
adb shell pm uninstall -k --user 0 com.lge.remote.setting
adb shell pm uninstall -k --user 0 com.lge.signboard
adb shell pm uninstall -k --user 0 com.lge.signboard.settings
adb shell pm uninstall -k --user 0 com.lge.snappage
adb shell pm uninstall -k --user 0 com.lge.sync
adb shell pm uninstall -k --user 0 com.lge.wallpaper.lightwave
adb shell pm uninstall -k --user 0 com.lge.wallpaper.nightsky
adb shell pm uninstall -k --user 0 com.lge.wifi.p2p
adb shell pm uninstall -k --user 0 com.lge.video.vr.wallpaper
adb shell pm uninstall -k --user 0 com.tmobile.services.nameid
I'm trying to create a little batch file to restart my new TicWatch pro it seems Not to measure my HR and other vitals whilst working out so I've thought that if I retstart it before going out for a run than it will be more likely to read correctly this is what I have now but it won't run the darn thing. I can do it manually but I'm missing the proper commands to automate in batch file format::
@Echo off
echo here we go.
pause
C:\Users\death\Downloads\MyBot.run788\lib\adb\adb.exe
adb devices
adb connect 192.168.0.53:5555
adb shell “pm clear com.google.android.gms && reboot”
Sorry scratch "pm clear" command darn it..
Also for some reason when tethered my PC doesn't see the TicWatch but I am able to connect via IP
Scratch that, it obviously wants to make me a liar I just tried again::
C:\Users\death\Downloads\MyBot.run788\lib\adb>adb devices
List of devices attached
192.168.0.53:5555 device
What happens::
I double click the batch file Echos:: here we go with request to unpause and then Nothing. I know its something simple but its alluding me pretty well.
i'm trying to create a batch to flash custom twrp recovery(for xiaomi devices), but if device is not connected it throws
error: no devices/emulators found
and i want to catch it to... well retry the rebooting to fastboot(aka bootloader), and i have zero idea how to do that, so i thought i could find some help here

How to install/enable uninstalled/disable app using adb command

Is it possible to reverse the process and to install or enable an app that has been previously uninstalled/disabled by one of the two adb commands below?
Code:
adb shell pm uninstall package_name
adb shell pm disable package_name
Rejerf said:
Is it possible to reverse the process and to install or enable an app that has been previously uninstalled/disabled by one of the two adb commands below?
Code:
adb shell pm uninstall package_name
adb shell pm disable package_name
Click to expand...
Click to collapse
Yes, I think so.

Can't ADB uninstall bloatware apps

I just purchased a Note10+. I tried to delete the bloatware using platform tools on linux. I am unable to do this. I am entering adb uninstall -k and then the package. I get an error saying the -k function can't work because it can't delete the data. It mentions doing an ADB shell which I have no idea how to do. Any suggestions as to what will work to delete the bloatware. I used this command on my Note9 and it worked then. Please advise.
Follow the tutorial/thread over at S10 forum. Worked fine for me
The general command is as follows:
Code:
adb shell pm uninstall -k --user 0 <package name>
As an example:
Code:
adb shell pm uninstall -k --user 0 com.samsung.android.app.spage
The complete for adb packages for the Note 9 is here,and it worked for my Note 10+
Give it a read and see if it helps.

Easy way to remove Indian specific software (Cloud, Redcable, etc.) from Indian 8T?

Hello,
is there an easy way to remove Indian software and notifications from an Indian 8T?
I have this "Login with OnePlus account" in Settings that I don't want to use for instance.
Thanks for your advice,
Nicolas.
Nice, I've managed to remove Cloud, Red Cable Club and the "Login with OnePlus account" in Settings without rooting by executing:
Code:
adb shell pm uninstall --user 0 com.oneplus.membership
adb shell pm uninstall --user 0 com.heytap.cloud
adb shell pm uninstall --user 0 com.heytap.openid
adb shell pm uninstall --user 0 com.heytap.mcs
Then rebooting.

adb command to get app list

Hello, can someone help me with adb pls?
With "adb shell pm list packages -f > c:\1.txt" I get a list of my installed apps as text file, is there any way to get a list of the installed default apps? Removing an app with "adb shell pm uninstall --user 0" removes it from the user profile, but I can reinstall it and I can reset my phone to get the apps back, that means they are all still installed on other level, is there a command like "adb shell pm list packages" to see the default apps? I want to get a list of the apps, user apps and system apps installed as if I had reset the phone or start it the first time.
Also, is there maybe a command for rebuild/delete cache? Just interested, because I have no idea if that is a thing today, with old Android versions it was helping sometimes but only possible with root.
With regards to apps that get installed by user ( called 3rd-party apps in contrast to system apps ) an app always gets installed in the space that's reserved for the user who invoked app's installation: typically it's user with id 0 - the default Android user. Knowing this then it will be clear that 3rd-party-apps on multi-user Android systems get installed in different user spaces.
Hence you always should add --user <USER-ID> to any action that should taken by PM.
To get list of installed system apps belonging to specific user you run
Code:
adb shell "cmd package list-packages -s --user <USER-ID>"
To get list of installed 3rd-party apps belonging to specific user you run
Code:
adb shell "cmd package list-packages -3 --user <USER-ID>"
jwoegerbauer said:
With regards to apps that get installed by user ( called 3rd-party apps in contrast to system apps ) an app always gets installed in the space that's reserved for the user who invoked app's installation: typically it's user with id 0 - the default Android user. Knowing this then it will be clear that 3rd-party-apps on multi-user Android systems get installed in different user spaces.
Hence you always should add --user <USER-ID> to any action that should taken by PM.
To get list of installed system apps belonging to specific user you run
Code:
adb shell "cmd package list-packages -s --user <USER-ID>"
To get list of installed 3rd-party apps belonging to specific user you run
Code:
adb shell "cmd package list-packages -3 --user <USER-ID>"
Click to expand...
Click to collapse
With adb shell cmd package list-packages -s --user 0 it closed without anything
With adb shell cmd package list-packages -s --user 0 -f > c:\2.txt I get Unknown command: list-packages
Same with using "adb shell cmd package list-packages -s --user 0" and adb shell "cmd package list-packages -s --user 0" -f > c:\2.txt
What I'm doing wrong?
Also, that's not exactly what I meant, even if the command is working I don't want the list of user 0, I want a list of the default apps. I already debloat the phone, I want to see the apps I debloat, the apps that are installed on admin(?) level to see if I can reinstall something that I need.

Categories

Resources