List of useful ADB and Fastboot commands for Android
ADB & Fastboot is often used when installing applications to the phone from the computer, or fixing some software errors that may be encountered on the device during use. Here, TECHRUM would like to share a list of some useful commands for Android compiled by Droidviews page, invite you to consult and use when necessary.
To use these commands first you need to enable Developer Mode, USB Debugging on your Android device, install the necessary drivers to ensure the correct connection between the phone and the device. computer and you will definitely need to refer to the following article: Instructions to install ADB & Fastboot on Windows, macOS and Linux
- adb help: Displays help documentation for ADB commands.
- adb devices: Shows all devices connected to adb, can be used to make sure your device is properly connected before doing any other operations.
- adb reboot: ADB can be used to reboot your device, this command is useful when the physical buttons on the device are not working or if you are using ADB. You can also reboot directly into recovery or bootloader mode with this command.
- adb reboot bootloader: Reboot the device into bootloader mode.
- adb reboot recovery: Reboot the device into recovery mode.
- adb install <path to APK file>: Can be used to install APK files on your Android device from your computer, extremely convenient compared to other workarounds like third-party support software Also this statement is often used by developers or debuggers.
- adb uninstall <package.name>: This command can be used to uninstall an installed application on the device.
- adb logcat: Displays log data on the screen.
- adb bugreport: Displays dumpsys, dumpstate and logcat data on the screen.
- adb jdwp: List JDWP (Java Debug Wire Protocol) processes on the device, if you do not know about it, you can skip this command.
- adb get-serialno: Show serial number
- adb get-state: Display the device's status
- adb wait-for-device: This command is used to program a delay before the next command is requested, it occurs when the device is connecting but another process is not completed.
- adb start-server: Command to start the server
- adb kill-server: Command to stop starting the server
- adb shell: Starts a remote shell command console in the device and allows you to control the device through it.
- adb shell wm density (dpi): Allows you to change the pixel density of the phone screen.
- adb shell pm uninstall -k –user 0 <name of package>: Allows you to uninstall system apps.
- adb sideload (path to update.zip): It works almost like you flash zip packages from recovery, but you can do it from your computer.
- adb pull [phone file path][computer storage location path]: This command can be used to copy any file from the smartphone and save it on the computer.
- adb push [computer location path][phone file path]: This command can be used to transfer a file from your computer to your smartphone.
These commands can only be used when the device is in fastboot mode, you need to change the state of the device by using the corresponding key combination or enter the command below.
adb reboot bootloader
- fastboot devices: Show all connected devices (use the same as the adb command to make sure the device is connected properly).
fastboot oem unlock: Unlock the bootloader on some Android devices (required)
fastboot oem lock: Used to re-lock the device's bootloader.
fastboot reboot bootloader: Reboot the device from fastboot mode back to fastboot mode, sometimes this may be necessary when you are flashing a package in fastboot mode.
fastboot flash: This command can be used to flash files to your device (including zip files, backups or restores).
fastboot flash boot boot_image.img: Flash the boot image to your device.
fastboot flash recovery recovery_image.img: Flash the recovery image to your device.
fastboot boot image_file.img: This command is used to boot your device with a certain image file without having to flash it first. It can be helpful to test a copy before flashing it.