ADB Fastboot Commands List for Android, Windows, Mac and Linux

ADB and Fastboot are mostly used for rooting your device, installing custom ROMs, and perform various other tasks.

However, to perform these tasks certain commands are assigned to execute these functions.

When connecting your phone to your computer using ADB and performing system tasks using Fastboot, you will need these commands to perform them.

Also Read: How to fix ‘ADB server is out of date, killing’ error

ADB means Android Debug Bridge, using which users can access system folders of their phone from their computer.

Talking about the Fastboot, you can have the access to the partition of the device that it would not reflect in real-time, not even after the changes.

There are various ADB and Fastboot commands that you must know. In this article, we will be discussing the ADB and fastboot commands that you should know.

Also Read: [Fixed] How to fix ADB devices unauthorized error

ADB And Fastboot Commands List For Android, Windows, Mac, and Linux

ADB Fastboot commands list
ADB and Fastboot commands list

ADB Commands

Given below are some ADB commands that you must know.

  • adb devices- This command list all the devices that you have connected to your computer, while USB debugging is on. This will ensure that your device is connected to your computer properly.
  • adb reboot- This command will reboot your device. You will not have to use the power button on your phone to reboot your phone, you can do it with the help of this command.
  • adb reboot bootloader- When you are installing custom ROMS or other modification packages, you will have to boot your phone to the bootloader. Using this command, you will be able to boot your phone to the bootloader.
  • adb reboot recovery- This command will reboot your phone to recovery mode. Whether you are running stock recovery or custom recovery on your PC, you will be able to boot to it using this command.
  • adb shell- This command enables a Linux terminal interface on the command window.
  • adb install -t<file path> –Using this command, you will be able to install any app to your phone for testing purposes.
  • adb install –r<file path> – This commands works with reinstalling any app that is already installed on your device.
  • adb install –f<file path> – Using this command, you will be able to install the app to the internal storage of your phone.
  • adb shell pm uninstall com.example.myapp – This will uninstall any app on your phone. Replace com.example.myapp with the file name of the app.
  • adb clear com.example.myapp – Using this command, you can clear the cache and data of the app, while not uninstalling it.
  • adb shell screenrecord <screenrecord location> – This command records the screen. You will have to replace <screenrecord location> with the location where you want to save the screen recording.
  • adb shell screencap <screenshot location> – This command can capture the screen/take snapshot. You will have to replace <screenshot location> with the patch where you want to save the screenshot.
  • adb push <file source> <file destination> – Using this command you will be able to copy files from your computer to your phone. Replace the file source with the location of the file from where you are copying it, and replace the file destination with the location where you want to save it.
  • adb pull <source> <destination> – Using this command, you will be able to copy the file from your phone to your computer.
  • adb logcat – This command displays the time log of your phone.
  • adb logcat > logcat.txt This command will save the time log of your phone to file logcat.txt
  • adb remount – This command will mount the partition of your phone to read/write if it was set to read-only.
  • adb sideload <file> – Using this command, you will be able to sideload any file to the device.
  • adb kill-server – This can kill an ADB process.
  • adb start-server – This command can restart the ADB process if you kill it using the adb kill-server command.
  • adb connect < device IP address> – You can connect the phone with Wi-Fi along with debugging access.
  • adb forward tcp:7100 tcp:6100 –  This will forward the host port from 7100 to 6100. You can replace the port with the port that applies.
  • adb-help – You can use this command to get help related to ADB.

Also Read: How to fix ADB not recognized error

Fastboot Commands

Fastboot commands
Fastboot commands

Given below are some Fastboot commands that you must know.

  • fastboot devices – This will list all the devices that are connected to the PC in the Fastboot mode.
  • fastboot reboot – This command will boot your phone to Fastboot/bootloader mode.
  • fastboot reboot recovery –Executing this command will boot your phone to recovery mode.
  • fastboot flashing unlock – This command is used to unlock the bootloader in the phones that came with Android Marshmallow or any Android version higher than that.
  • fastboot oem unlock – This command unlocks the bootloader on the phone that came with Android Lollipop.
  • fastboot flashing unlock-critical – This unlocks the bootloader for a different condition like updating the phones manually and updating the bootloader.
  • fastboot OEM lock – This command locks the bootloader after unlocking. This command can only be used for the phones that came with Android Lollipop or any prior version to that.
  • fastboot flashing lock – You can use this command to lock the bootloader on the phone that came with Android Marshmallow or higher.
  • fastboot flashing lock_critical – Using this command you can lock the bootloader if you have unlocked it using the flashing unlock-critical command.
  • fastboot flash boot boot.img- This commands flashes the boot image files to the phone. However, when using the command, ensure the boot file is renamed to ‘boot.img’, else it will not work.
  • fastboot flash recovery recovery.img – You can use this command to flash custom recovery or a stock recovery image on your phone. Before you continue with this command, ensure the recovery image file is renamed to ‘recovery.img’.
  • fastboot flashall –w – This command wipes the data partition on your phone.
  • fastboot oem device-info- You can check the bootloader status (locked or unlocked) using this command. It will return true if unlocked, and false if locked.
  • fastboot format: ext4 userdata- This command wipes the data from the ext4 partition.
  • fastboot boot recovery.img –  Using this command, you can boot into recovery temporarily. Ensure you rename the recovery file to ‘recovery.img’.
  • fastboot erase data- If you want to clean flash a room, then this command erases all the data on your phone.
  • fastboot erase system- This command will erase the system from your phone for you to flash a new ROM.
  • fastboot erase cache- Using this command, you can delete all cache from the phone.
  • fastboot erase system –w – This command erases cache, data, and system on your phone.
  • fastboot flash system system.img- This command can flash the system image to the phone.
  • fastboot flash userdata data.img – This command can flash the user data image.
  • fastboot boot kernet ramdisk- The user can use this command to test the custom kernel.
  • fastboot flash zip file.zip- You can flash zip files using this command.
  • fastboot getvar mid- Using this Fastboot command you can get the device model number.
  • fastboot getvar all – This command will give the information about the device model, IMEI, radio, and various other things.

Also Read: How to flash Stock Firmware with fastboot commands

Final Words

These were some ADB and Fastboot commands that you can use when customizing or controlling your phone.

These commands will be quite handy when are using ADB or Fastboot on your device.

Anurag Jain

A content writer, tech geek, and fitness enthusiast out there to explore the world.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts