0% found this document useful (0 votes)
51 views

Useful ADB and Fastboot Commands and How To Use Them

The document discusses useful ADB and Fastboot commands for Android development and device management. It lists common ADB commands like adb devices, adb reboot, adb install/uninstall to manage apps, and adb push/pull to transfer files. It also covers Fastboot commands such as fastboot flash to flash firmware files and fastboot erase to wipe partitions. The document recommends installing ADB/Fastboot drivers and provides a guide on basic usage.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Useful ADB and Fastboot Commands and How To Use Them

The document discusses useful ADB and Fastboot commands for Android development and device management. It lists common ADB commands like adb devices, adb reboot, adb install/uninstall to manage apps, and adb push/pull to transfer files. It also covers Fastboot commands such as fastboot flash to flash firmware files and fastboot erase to wipe partitions. The document recommends installing ADB/Fastboot drivers and provides a guide on basic usage.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2/26/2020 Useful ADB and Fastboot Commands and How to Use them

Useful ADB and Fastboot Commands and How


to Use them
By Usama M - August 22, 2018

ADB an official tool by Google – you must have heard of it if you have ever come across
Android development or flashing processes. Stands for Android Debug Bridge basically
and helps you to establish a connection and communicate between your phone and your
computer. ADB has a command-line interface, which helps the
developers/programmers/users to enter commands and do the stuff they want. ADB also
plays an important role when you don’t have access to certain things on your phone, you
can simply handle the problem through the command window.

Earlier we posted a guide on “How to Install and Use Android ADB & Fastboot” but
missed the important ADB commands that may become handy in some cases, and found
necessary to cover them now. In case you’re wondering about Fastboot, it’s a component
of ADB that helps you to flash files or make tweaks by accessing Fastboot mode on your
device. Well, let’s get back to the topic. In the following post, I’ve listed the useful ADB
commands, and also explained their use.

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 1/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

You may want to install Android ADB and Fastboot, and also learn how to use the
program actually please go through this guide:

How to Install Android Adb & Fastboot Drivers on Your Windows PC


[Guide]

Useful ADB & Fastboot Commands

Commands Use

Basic ADB Commands

adb devices Shows a list of devices attached to the computer.

adb reboot Reboots a device connected to the PC.

adb reboot recovery Reboots a device into recovery mode.

adb reboot download Reboots the connected device into download mode
E.G Download mode on Samsung Galaxy devices.

adb reboot bootloader Reboots a device into Bootloader. Once in


Bootloader, you can make further selections here.

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 2/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

Commands Use

adb reboot fastboot Reboots a connected device into Fastboot mode.

Installing / Uninstalling / Updating Apps with ADB.

adb install .apk ADB install let's you install APK files directly to you
phone. To use this command type adb install
application path, as shown in the commands part
and hit enter key and it will start installing the app
on your phone. e.g adb install
C:/Users/UsamaM/Desktop/CandyCrushSaga.apk.
process succeeds it will show you "Success" in the
command window.

adb install -r .apk If you have already installed an app, and you just
want to update it then this command will let you do
so. e.g adb install -r
C:/Users/UsamaM/Desktop/CandyCrushSaga.apk

adb unistall package_namee.g Uninstalls and application from your device. The
easiest way to find a package name is, install
adb uninstall com.android.chrome Package Name Viewer from the play store and find
the name of the package under the App Name. If
process succeeds it will show you "Success" in the
command window.

adb uninstall -K package_namee.g Uninstall an app but keeps it's data and cache
directories. If process succeeds it will show you
adb uninstall -K com.android.chrome "Success" in the command window.

Push and Pull files

adb rootadb push >e.gadb push the adb push commands you transfer any files to
c:\users\UsamaM\desktop\Song.mp3 your phone from your PC. You simply need to
\system\media provide the path of file on your PC and path where
to place this file on your phone.
adb push
filepathonPC/filename.extension
path.on.phone.toplace.the.file

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 3/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

Commands Use

adb rootadb pull>e.gadb pull Similar to the adb push command. Using adb pull,
\system\media\Song.mp you can simply pull any files from your phone.
C:\users\UsamaM\desktop

adb pull [Path of file on phone]


[Path on PC where to place the file]

Backing up system and installed apps.

Before doing this, in your adb folder create a folder Backup and under the backup folder
create two folders named SystemApps and InstalledApps.

These folders are necessary as you'll be pushing the backed up apps to these folders.

adb pull /system/app backs up all the system apps of your phone to the
backup/systemapps Systemapps folder that you created in the ADB
folder.

adb pull /system/app backs up all the installed apps of your phone to th
backup/installedapps installed apps folder that you created in the ADB
folder.

Background Terminal

adb shell starts the background terminal.

exit exits the background terminal.

adb shell e.g adb shell su switches to the root of your phone. Please make
sure that you're rooted in case you wish to use adb
shell su.

Fastboot commands

To flash files using fastboot, place the desired files in Fastboot folder or Platform-tools
folder that you obtained after installation of Android SDK tools.

Fastboot Flash File.zip Flashes a .zip file to your phone, when your phone
is connected in Fastboot mode.

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 4/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

Commands Use

Fastboot Flash recovery Flashes a recovery to your phone when it's


recoveryname.img connected in Fastboot mode.

Fastboot flash boot bootname.img Flashes a boot or kernel image when your phone is
connected in Fastboot mode.

Fastboot getvar cid shows you the CID of your phone.

Fastboot oem writeCID xxxxx writes the super CID.

fastboot erase system In case you want to restore a nandroid backup,


you'll have to delete the current system/data/cach
fastboot erase data of your phone first. Before doing this, it is always
recommended to have backed up your system usin
fastboot erase cache a custom recovery>backup option and copy the
backed up .img files to Fastboot or Platform-tools
folder in Android SDK folder. Then performing thes
commands will erase everything.

fastboot flash system system.img These commands will restore the backup that you
made using a custom recovery on your phone and
fastboot flash data data.img placed in the Fastboot folder under Android SDK
tools.
fastboot flash cache cache.img

fastboot oem get_identifier_token These commands help you to get the identifier
token of your phone that can be used for unlocking
fastboot oem flash Unlock_code.bin the bootloader. The second command helps you to
flash the bootloader unlock code, and the 3rd
fastboot oem lock commands help you to lock your phone's bootloade
once again if locking it is actually allowed.

Logcat

adb logcat Shows you the real-time logs of your phone, these
logs represent the ongoing process on your device
It is recommended that you run this command
while your device boots up to check what's going
on.

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 5/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

Commands Use

adb logcat > logcat.txt Creates a .txt file containing the logs in the
Platform-tools folder or Fastboot folder in Android
SDK tools directory.

Here is a complete list of all the important and useful ADB & Fastboot Commands.
That’s all for now. We may be missing a lot of commands, those may be added later. In
case you got any suggestions, queries or face any difficulties, please feel free to stop by
the comment box below and drop your words. We will get back to you as quick as we
can. Thanks All!

Usama M
Usama M, a software engineer by profession, is the founder and editor-in-chief at Techbeasts. At
Techbeasts, he uses his expertise to craft solutions to solve everyday consumer tech problems. His main
areas of interest are Android, iOS, and Windows. You can find him on YouTube at "Tech with Usama".

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 6/7
2/26/2020 Useful ADB and Fastboot Commands and How to Use them

  

https://techbeasts.com/useful-adb-and-fastboot-commands-and-how-to-them/ 7/7

You might also like