ADB (Android Debug Bridge) is a useful tool for managing Android devices. Below are a few simple yet useful commands I frequently use (which have proved especially useful after borking some functionality on my ereader, but that's how we learn).
adb devices- Lists connected Android devices.
adb shell pm uninstall -k --user 0 [package_to_uninstall]- Uninstalls an existing package from user (can be reenabled with
adb shell pm disable-user --user 0 [package_to_disable]- Disable a package from the device. Typically cant be reenabled from the device without using ADB.
adb shell pm list packages -f- Lists all installed user and system packages. It's helpful to pipe the output into a text file by appending
> [text file name]to the end of this command.
diff <(adb shell pm list packages) <(adb shell pm list packages -u)- Lists uninstalled packages by showing the difference between the output of the list command and the list command with the "-u" operator. Also helpful to pipe it into a text file with
> [text file name].
adb shell pm enable [package_to_enable]- Enables a previously disabled packaged.
adb shell cmd package install-existing [package_to_reinstall]- Reinstall a package that was previously uninstalled. You will also need to run the "enable" command above.
adb reboot- Reboots device.
adb reboot fastboot- Reboot connected device into fastboot mode.
adb reboot recovery- Reboot connected device into recovery mode.
Managing files is very similar to managing files in the Linux command line, however you need to include
adb shell before using commands like ls, mv, cp, etc. Transfering files between your computer and the Android device can be done with the following.
adb pull /sdcard/path/of/file destination/of/file- Pulling a file from the Android device to your local computer.
adb push /location/of/file /sdcard/destination/of/file- Push file from your local computer to the Android device.
Sadly, there is no traditional manual entry for ADB, but you can run
adb --help for some useful commands/tips. You can also read more on the Android Debug Bridge Arch Wiki page as well as adbshell.com.
Thanks for reading. Feel free to send comments, questions, or recommendations to email@example.com.