Skip to content

Instantly share code, notes, and snippets.

@RandallFlagg
Created June 13, 2024 19:29
Show Gist options
  • Save RandallFlagg/c976e5d5e30518fc3df866ccbf0c102b to your computer and use it in GitHub Desktop.
Save RandallFlagg/c976e5d5e30518fc3df866ccbf0c102b to your computer and use it in GitHub Desktop.
Install ADB:
On void Linux(other distros might have a different package name)
xi android-tools
xi android-udev
sudo usermod -aG plugdev $LOGNAME
sudo reboot now #This will reboot the machine
All the shell commands can be run from within the shell by logging into the shell and ommiting the adb shell from the begining:
List all android devices connectes to the machine running the adb:
adb devices
Log into the android shell:
adb shell
Get all installed packages using:
OLD: adb shell pm list packages
NEW: adb shell cmd package list packages
To see user installed packages:
adb shell pm list packages -3 | cut -f 2 -d ":"
To stop a running app:
adb shell am force-stop <package name>
Clearing of packages and also deletes their data:
adb shell pm clear <package name>
List all running apps/proccesses:
to monitor the top five CPU hogging processes:
adb shell top -m 5
adb shell top -m 5 -s cpu -n 20 |tee top.log
Uninstall a system app:
pm uninstall -k --user 0 <package name>
Re-enable Any Disabled Pre-installed System App:
Lists all disabled packages:
adb shell pm list packages -d
Re-enable the app:
adb shell pm enable <package_to_enable>
Commands:
adb am force-stop <package name>
adb shell pidof <package name> | xargs adb shell kill
Root Commands:
* adb shell ps -A | grep <package name> | awk '{print $2}' | xargs adb shell kill
* android$ adb -d shell
android# su
android# ps
android# kill <process id from ps output>
Additonal Reading:
https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/
At anypoint, if you have any issues or if you ran a command and you didn't see the expected result, try rebooting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment