• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Get Droid Tips

Get Droid Tips

Custom ROM | CyanogenMod | Android Apps | Firmware Update | MiUi | All Stock ROM | Lineage OS |

  • Android
  • Games
  • iPhones/iPad
  • Social Media
  • Windows
  • LineageOS 17.1
  • Android 10
  • iOS 14
  • Free Among Us for PC
  • Write for US
  • Watch IPL 2020 For Free
Home Android Tips & Tricks

Basic ADB and Fastboot commands that you should learn to become Android Pro

Updated on January 16, 2021 by Rahul Verma

Advertisements
Updated on March 01, 2020: We added more adb commands to make this tutorial even better. You can bookmark this page for future reference to tweak your Android device.

Most of us can talk to our device via fingers – touch screen if I may. However, there are certain cases when the touchscreen doesn’t work, or the whole device doesn’t work for that matter. In such a case, you should know at least basic ADB commands to get your things done. These include waking up your device setting up fast reboot, factory reset, etc. Anyway there’s nothing wrong with learning new skills, right? So without a further do, let us start with few basic ADB commands for android smartphones.

Before we start, we want to declare that this won’t be any full detailed discussion on ABD commands. These are all the important ones that you should know in case you lost control over your device. That includes being in a frozen state, or your data is damaged, you cant access your device, and whatnot. These ADB commands will help you to revive your device from a dead state or will help you to copy stuff here and there. These are easy to use tools that will be helpful for you in the future.

Also Read: WebADB: Run ADB from Your Web Browser (Chrome, Edge or Any)

Basic ADB command that you should learn to become Android Pro

Table of Contents

  • 1 Basic ADB command that you should learn to become Android Pro
  • 2 How to Install and Setup ADB and Fastboot Tool?
    • 2.1 1. The ADB devices command
    • 2.2 2. The adb push command
    • 2.3 3. The adb pull command
    • 2.4 adb pull <remote> [local]
    • 2.5 4. The adb reboot command
    • 2.6 5. The adb reboot-bootloader and adb reboot recovery commands
    • 2.7 6. The fastboot devices command
    • 2.8 7. The fastboot unlock command
    • 2.9 8. The adb shell command
    • 2.10 9. The adb install command
    • 2.11 10. The adb sideload command

Basic ADB command that you should learn to become Android Pro

Every Android developer or Android enthusiast should know some basic ADB commands. Because why not? You can achieve a lot more using these basic ADB commands. Using basic ADB commands is just like using keyboard shortcuts. They make things easier to operate. So let us start with a few Basic ADB commands.

Advertisements

How to Install and Setup ADB and Fastboot Tool?

We have a detailed guide on how to install ADB and Fastboot tool on Windows and we also have a separate guide on how we can install ADB Fastboot on Mac or Linux.

Setting up ADB and Fastboot is very easy. As ADB and Fastboot both are a part of the Android SDK package, only you to download the kit (which is over 500 MB) and then set up path variables, or the below-written methods can be used to install ADB and fastboot driver on Windows and macOS. But first, you need to remember that you have to put your device into USB debugging mode, but before that, you need to enable the developer option. If you just ignore this step, the possibility is your PC won’t recognize your device.

Note:
Before starting, make sure that you don’t try these commands until and unless they are absolutely necessary.
Warning!
We editors at GetdroidTips do not bear any responsibility for any damage which is caused by the g use of these basic ADB commands

1. The ADB devices command

The “adb devices” is a very popular ADB command which we use to list all the devices in command prompt which are ready to take commands in for action. Nevertheless to say that it is one of the most important commands as without using adb devices you won’t be able to operate on your smartphone at all.

adb devices
Note
You need to make sure that Android USB debugging mode is turned on in your Android device. The command “adb devices” won’t work if USB debugging is disabled.

If you’re an android pro, then you must know this command as it will tell you whether your PC and Android device are connected via android debug bridge or not.

Advertisements

2. The adb push command

This command is useful when you need to move files to your android device programmatically. For this to work, you need to know a few parameters like the name of the file and full path of the file. After that, you can push files in your device.

Upload a specified file from your computer to an emulator/device.

adb push <local> <remote>

adb push test.apk /sdcard

Copies <android-sdk-path>/platform-tools/test.apk to /sdcard directory.

Advertisements
adb push d:\test.apk /sdcard

In the above example, you will see how you can push a song file into the music folder on your smartphone.

3. The adb pull command

This command is used to pull stuff out of your device. In this scenario, you can pull out files and folders from your device to your computer. All you need to know is the file or folder name in order to move files. These push and pull commands are extremely useful when you want to take a backup of your device.

Download a specified file from an emulator/device to your computer.

adb pull <remote> [local]

adb pull /sdcard/demo.mp4

download /sdcard/demo.mp4  to <android-sdk-path>/platform-tools directory.

adb pull /sdcard/demo.mp4 e:\

download /sdcard/demo.mp4 to drive E.

4. The adb reboot command

adb reboot

This is an extremely useful command for custom ROM makers and Android developers in general. There are times when developers need to reboot the android devices. So its easier to type the command rather than physically pressing the button. Also, this can also be automated using a script while installing a custom kernel or a custom ROM. In short- it is very useful command even for day to day Android users.

5. The adb reboot-bootloader and adb reboot recovery commands

The previous command we just discussed can be used to reboot a device. However, there are other basic ADB commands which you can use to reboot your device in a certain mode.

adb reboot recovery

Herewith “adb reboot recovery” command, you can reboot your device into bootloader mode. Doing it is easy, just type adb reboot-bootloader and hit the enter key.

adb reboot bootloader

This command will boot your device into bootloader where you can unlock your bootloader, reboot into fastboot and recovery mode, and do some other tasks.

Also read: How to Install TWRP on Huawei Watch

6. The fastboot devices command

When you are in the bootloader mode, none of your so-called ADB commands will work. This is because the android is not booted up and USB debugging bridge is not activated to communicate with. So in such scenarios, we use “fastboot” command to communicate with the device.

Fastboot is one of the best and lifesaving adb command available to Android users. You can pass files, communicate, revive deal smartphones and much more. But make sure that you have adequate fastboot drivers for your android device because adb drivers won’t work here.

adb reboot fastboot

You can use the above command to boot your device directly to fastboot mode.

fastboot device

This command will check if the device is connected to PC.

Also read: How To Remove Moto Z2 Force Unlocked Bootloader Warning Message

7. The fastboot unlock command

If you want to unlock bootloader for your android device, then this command will help you get through it. However unlocking bootloader is not supported on every device, but if it does. You can do it via fastboot command. This is the beauty of android open system as Google and smartphone manufacturers don’t care what the users do with their device. They are open to doing any kind of experiments.

Here is few bootloader unlock command:

fastboot flashing unlock
fastboot oem unlock

To check whether your device bootloader unlocked or not

fastboot oem device-info

8. The adb shell command

This is one of the confusing one, but it is very useful command folks. You can use this to send commands to your device to run its own scripts and commands. How cool is that? Also, you can actually see what your device command shell is doing on your screen.

In this image above, you can see inside the device shell. Just type “adb shell” and enter. You will enter into device shell mode.

Note
This is not a DOS-based command shell. It’s same as what people use in Linux or Mac computers, so use it wisely.

9. The adb install command

We already talked about adb push and pull commands. But did you know that you can actually install apps in your device with a simple command? Wow, sounds great, right? You just need the path where you have saves the .apk file of the app. After that you need to enter the command like this:

adb install TheAppName.apk 

If you’re planning to update an existing app, then you need to write it like this

adb install -r TheAppName.apk

10. The adb sideload command

Do you want to update your device with an unofficial OTS (over the air) update? We gotcha fam! You can download and un-official /official OTA update and install it via adb sideload command. All you need to do is boot into recovery and use up/down keys to navigate to “Apply update from ADB”. After that, type in this command and you’re good to go:

adb sideload Full-Path-to-the-file.zip
Command Functions
ADB Commands
adb devices Shows attached devices
adb shell To jump from windows command prompt to android device shell:
adb reboot bootloader To boot into bootloader mode
adb reboot recovery To boot into recovery
adb get-serial no Get Serial Number of your connected device
adb install To install apps over adb
adb install -r To update the existing apps with  new version
adb uninstall package_name.here To uninstall any apps or packages from the connected device
adb uninstall -package_name.here Keep the data and cache directories after uninstalling apps
adb push <local> <remote> Upload a specified file from your computer to device
adb pull Download a specified file from your device to your computer.
adb backup Take backup from your device to PC
adb restore Restore the backup to your phone
adb sideload To sideload apps or flashable zip file to your device
adb logcat Take the realtime log from your phone
adb start-server start adb servers processes
adb kill-server stop adb server processes
adb reboot fastboot reboot your device into fastboot mode
adb usb shows all devices connected to your computer via a USB cable.
adb devices //show devices attached It will display the list of all devices attached to your PC.
adb connect ip_address_of_device connect the IP address of your Android device to your computer.
Fastboot commands
fastboot devices Shows connected devices on your PC/Laptop
fastboot reboot To reboot your device
fastboot reboot recovery To boot your device into recovery mode
fastboot oem device-info To check the bootloader unlock status:
fastboot oem unlock If the above command returns fall, run the following to unlock the bootloader
fastboot flashing unlock Few OEM may use this command to unlock bootloader
fastboot flashing unlock_critical Allow flashing of bootloader related partitions too:
fastboot oem device-info check bootloader lock/ unlock status
fastboot flash recovery [recovery.img] To flash recovery on your device
fastboot boot [boot.img] To test the recovery without permanently flashing
fastboot format:ext4 userdata To format data partition
fastboot flash boot [boot img name] flash flashable boot.img from fastboot mode
fastboot getvar cid To display CID of your device
Flashing ROM via Fastboot ROM zip package

fastboot -w
fastboot update </path/to/your/Rom.zip>

To wipe your device and then to flash.zip

Well, guys, these are all the basic ADB commands which you need to know if you’re an android fan. I’m sure you learned a lot of new things today. Let us know which command you liked the most in the comment section below.

Related Posts:

  • Download ADB, Fastboot – Android SDK Platform Tools
  • uBlock Origin vs Adblock Plus: Which Adblocker To Choose 2018
  • Download Android USB Drivers for Windows and Mac
  • How to Manually Install Android USB Drivers on your PC

ADB

Primary Sidebar

Buying Guide

Tenorshare 4uKey – Bypass iPhone Lockscreen Without Any Hassle

Best Alternatives to Amazon Shopping App

Top 6 Smartphones on Black Friday Deals 

Best Motherboards for the AMD Ryzen 9 5900X

Best Power Supply Unit (PSU) For Nvidia RTX 3090, 3080, And 3070 GPU

Best 3D Mu6 Dummy Head Recording Earphone

Best Hidden Cams To Buy in 2020

60Hz vs 144Hz vs 240Hz Monitors – Differences and Purchase Guide

How To Use PayPal On Amazon To Shop Safely?

RTX 3070 vs 3080 vs 3090: Differences, Performance, Design, Price, and More

Advertisements
Advertisements

© 2021 · Get Droid Tips

  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Editorial Policy
  • Terms of Use
  • Write for Us