• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Gizmo Advices

Gizmo Advices

Gizmo Advices is a tech blog on Google Android OS, Apple iOS, Windows Phone etc. It provides latest news and How to Tutorials & Guides.

  • Downloads
    • Android USB Drivers
    • Apps
    • Gapps
    • Wallpapers
  • How to
    • Bootloader
    • Custom Recovery
    • Custom ROM
    • Root
    • Stock Firmware
    • Screenshot
    • iOS
    • Tips and Tricks
  • Best List
  • Best Deals
  • Reviews
  • Contact Us
How to

Complete List of ADB Commands and Fastboot Commands

Last Updated: August 25, 2020 by Alpesh

Android Debug Bridge (adb) is a command-line tool that lets you run commands on the connected Android device or an emulator. It is widely used for development purposes and is already available in Android Studio in android sdk/platform-tools. The commands which are run on the device through ADB are called "adb commands". Here we are going to have a look at the complete list of adb and fastboot commands and what actions they perform.

ADB Commands and Fastboot Commands

Table of Contents

  • 1 How Android Debug Bridge (adb) works?
  • 2 List of ADB Commands and their Functions
    • 2.1 adb devices
    • 2.2 adb forward
    • 2.3 adb kill-server
    • 2.4 adb connect
    • 2.5 adb usb
    • 2.6 adb install
    • 2.7 adb uninstall
    • 2.8 adb shell pm list packages
    • 2.9 adb shell pm path
    • 2.10 adb shell pm clear
    • 2.11 adb pull
    • 2.12 adb push
    • 2.13 adb shell ls
    • 2.14 adb shell cd
    • 2.15 adb shell rm
    • 2.16 adb shell mkdir
    • 2.17 adb shell touch
    • 2.18 adb shell pwd
    • 2.19 adb shell cp
    • 2.20 adb shell mv
    • 2.21 adb shell netstat
    • 2.22 adb shell ping
    • 2.23 adb shell netcfg
    • 2.24 adb shell ip
    • 2.25 adb logcat
    • 2.26 adb shell dumpsys
    • 2.27 adb shell dumpstate
    • 2.28 adb shell screencap
    • 2.29 adb shell screenrecord
    • 2.30 adb root
    • 2.31 adb sideload
    • 2.32 adb shell ps
    • 2.33 adb shell top
    • 2.34 adb shell getprop
    • 2.35 adb shell setprop
  • 3 What is Fastboot?
  • 4 List of Fastboot Commands and their Operations
    • 4.1 fastboot devices
    • 4.2 fastboot reboot
    • 4.3 fastboot reboot recovery
    • 4.4 fastboot oem unlock
    • 4.5 fastboot oem lock
    • 4.6 fastboot oem device-info
    • 4.7 fastboot flash recovery
    • 4.8 fastboot boot
    • 4.9 fastboot flash
    • 4.10 fastboot getvar cid

How Android Debug Bridge (adb) works?

According to Wikipedia, the adbd daemon runs on the device and the adb client starts a background server to multiplex commands sent to the connected device.

Below is the list of adb commands and fastboot commands along with the description of what operations it performs.

List of ADB Commands and their Functions

adb devices

This command prints a list of all attached devices with USB Debugging enabled. In response, it returns the serial number and state of the device.

Syntax:

adb devices

Response:

a123a456            device

adb forward

This command forwards the socket connections. It required USB Debugging enabled on the device.

Syntax:

adb forward <local> <remote>

Example:

adb forward tcp:6100 tcp:7100

Set up forwarding of the host port 6100 to emulator/device port 7100

adb kill-server

It terminates the adb server process. Sometimes you might want to terminate the adb server and restart it to resolve the problems.

Syntax:

adb kill-server

adb connect

The adb connect command allows using adb over Wi-Fi. It requires the host and the device connected to the same Wi-Fi network.

Syntax:

adb connect <host>[:<port>]

To use ADB over Wi-Fi, firstly connect the device to PC and set TCP IP port to 5555 using "adb tcpip 5555" command. Now find the IP address of the device from Settings -> About -> Status -> IP address. Now you can use adb connect command to use ADB over Wi-Fi.

Example:

adb connect 192.168.x.x:5555

adb usb

Restarts ADB in USB mode.

Syntax:

adb usb

adb install

The adb install command pushes an Android application (.apk) from host to an emulator or the device.

Syntax:

adb install [option] <path to .apk>

Example:

adb install test.apk

adb uninstall

Uninstalls or removes the package from the emulator or Android device.

Syntax:

adb uninstall [option] <PACKAGE>

Example:

adb uninstall com.test.app

adb shell pm list packages

The adb shell pm list packages command prints all packages installed on the device/emulator.

Syntax:

adb shell pm list packages [options] <FILTER>

Example:

adb shell pm list packages

adb shell pm path

The adb shell pm path command is used to prints the path to the APK of the given package.

Syntax:

adb shell pm path <PACKAGE>

Example:

adb shell pm path com.android.phone

adb shell pm clear

This command deletes all the data associated with the package (clears app data and cache).

Syntax:

adb shell pm clear <PACKAGE>

Example:

adb shell pm clear com.test.app

adb pull

Downloads or pulls a specified file from an emulator/device to your computer (host).

Syntax:

adb pull <remote> [local]

Example:

adb pull /sdcard/test.mp4

To download test.mp4 to drive D below command is used.

adb pull /sdcard/test.mp4 d:\

adb push

The adb push command is used to upload or push or copy a file from the host (computer) to an emulator or the device.

Syntax:

adb push <local> <remote>

Example:

adb push d:\test.mp4 /sdcard

adb shell ls

Lists directory contents.

Syntax:

ls [options] <directory>

Example:

adb shell
ls

adb shell cd

Change the directory or folder.

Syntax:

cd <directory>

Example:

adb shell
cd /system

adb shell rm

The adb shell rm command is used to remove files or directories.

Syntax:

rm [options] <files or directory>

Example:

adb shell
rm /sdcard/test.pdf

adb shell mkdir

Make a directory or create a folder.

Syntax:

mkdir [options] <directory name>

Example:

adb shell
mkdir /sdcard/test

adb shell touch

Create an empty file or change file timestamps.

Syntax:

touch [options] <file>

Example:

adb shell
touch /sdcard/test.txt

adb shell pwd

Prints the current working directory location.

Syntax:

pwd

Example:

adb shell
pwd

adb shell cp

Copy files and directories.

Syntax:

cp [options] <source> <destination>

Example:

adb shell
cp /sdcard/text.txt /sdcard/folder/

adb shell mv

Move or rename files.

Syntax:

mv [options] <source> <destination>

Example:

adb shell
mv /sdcard/tmp /system/tmp

adb shell netstat

Shows network statistics.

Syntax:

netstat

Example:

adb shell
netstat

adb shell ping

Test the connection and the latency between two network connections.

Syntax:

ping [options] <destination>

Example:

adb shell
ping www.android.com

adb shell netcfg

Manage and configure network connections via profiles.

Syntax:

netcfg [<interface> {dhcp|up|down}]

Example:

adb shell
netcfg

adb shell ip

Show, manipulate routing, devices, policy routing, and tunnels.

Syntax:

ip [options] object

object := { link | addr | addrlabel | route | rule | neigh | ntable |tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |netns | l2tp }

optoins := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |-f[amily] { inet | inet6 | ipx | dnet | link } |-l[oops] { maximum-addr-flush-attempts } |-o[neline] | -t[imestamp] | -b[atch] [filename] |-rc[vbuf] [size]}

Example:

adb shell
ip -f inet addr show wlan0

adb logcat

Prints log data on the screen.

Syntax:

adb logcat

adb shell dumpsys

Dumps system data.

Syntax:

adb shell dumpsys [options]

Example:

adb shell dumpsys
adb shell dumpsys batterystats

adb shell dumpstate

Dumps state.

Syntax:

adb shell dumpstate

adb shell screencap

The adb shell screencap command takes a screenshot of the device’s display.

Syntax:

adb shell screencap <filename>

Example:

adb shell screencap /sdcard/screenshot.png

adb shell screenrecord

The adb shell screenrecord command records the device’s screen. It requires the device to be running on Android 4.4 (API level 19) or higher.

Syntax:

adb shell screenrecord [options] <filename>

Example:

adb shell screenrecord /sdcard/screen.mp4

adb root

The adb root command is used to restarts the adbd daemon with root permissions.

Syntax:

adb root

adb sideload

Sideloads OTA update.zip package and other files on the device. Know more about adb sideload here.

Syntax:

adb sideload <file.zip>

Example:

adb sideload update.zip

adb shell ps

Prints process status.

Syntax:

ps [options]

Example:

adb shell
ps

adb shell top

Displays top CPU processes.

Syntax:

top [options]

Example:

adb shell
top

adb shell getprop

Get property via the android property service.

Syntax:

getprop [options]

Example:

adb shell
getprop

adb shell setprop

This command is used to set property service.

Syntax:

setprop <key> <value>

Example:

adb shell
setprop service.adb.tcp.port 5555

What is Fastboot?

Fastboot is a diagnostic protocol primarily used to modify the flash filesystem via USB connection from the host computer. It requires the device to be booted into boot loader mode or fastboot mode or secondary program loader mode. Once the fastboot protocol is enabled, it accepts the commands sent to it via USB using the command-line interface.

List of Fastboot Commands and their Operations

Below is the list of fastboot commands which can be used to perform certain operations when the device is connected to the computer (host) in Fastboot mode / Bootloader mode.

fastboot devices

This command is similar to adb devices; it prints a list of all attached devices in fastboot mode. In response, it returns the serial number of the device.

Syntax:

fastboot devices

fastboot reboot

The fastboot reboot command reboots the device to normal or standard mode. Used to exit the fastboot mode or boot loader mode.

Syntax:

fastboot reboot

fastboot reboot recovery

The fastboot reboot recovery command boots the device into Recovery Mode.

Syntax:

fastboot reboot recovery

fastboot oem unlock

The fastboot oem unlock command unlocks bootloader on the device.

Syntax:

fastboot oem unlock

fastboot oem lock

Used to relock the bootloader on the device.

Syntax:

fastboot oem lock

fastboot oem device-info

Prints bootloader lock/unlock status.

Syntax:

fastboot oem device-info

fastboot flash recovery

The fastboot flash recovery command is used to flash the recovery image to the device.

Syntax:

fastboot flash recovery <file-name.img>

Example:

fastboot flash recovery twrp.img

fastboot boot

Used to boot the image file without installing or flashing on the device. Can be used to boot recovery image without flashing on the device.

Syntax:

fastboot boot <file-name.img>

Example:

fastboot boot recovery.img

fastboot flash

Flashes flashable zip file from fastboot or bootloader mode.

Syntax:

fastboot flash <file.zip>

Example:

fastboot flash update.zip

fastboot getvar cid

Displays CID (Carrier ID) of the device.

Syntax:

fastboot getvar cid

This was the complete list of ADB and Fastboot commands. However, to use the above fastboot and adb commands, make sure you have installed ADB and Fastboot drivers – Windows and Mac.

If you find this post helpful, then don’t forget to share it with your friends on Facebook, Twitter, and other social media platforms.

Complete List of ADB Commands and Fastboot Commands was last modified: August 25th, 2020 by Alpesh

This page may contain affiliate links so we earn a commission. Please read our affiliate disclosure for more info.

FacebookTwitterWhatsAppRedditPin It

👇👇Latest Video on YouTube 👇👇

RELATED POSTS

  • What is ADB Sideload? How to Install OTA / Sideload ROMs and Mods on Android

    What is ADB Sideload? How to Install OTA / Sideload ROMs and Mods on Android

  • Download Android USB Drivers for Windows and Mac

    Download Android USB Drivers for Windows and Mac

  • How to Setup ADB and Fastboot drivers on Windows PC [Guide]

    How to Setup ADB and Fastboot drivers on Windows PC [Guide]

Reader Interactions

JOIN THE DISCUSSION: Cancel reply

We never share our visitor/user details. For more info, Please read our privacy policy before submitting your comment.

Primary Sidebar

YOU MIGHT ALSO LIKE…

  • Mobvoi TicWatch Pro 3 [Review] Mobvoi TicWatch Pro 3 [Review]
  • How to Fix Message+ Keeps Stopping? Solutions to Verizon Message+ Crashing How to Fix Message+ Keeps Stopping? Solutions to Verizon Message+…
  • What is ADB Sideload? How to Install OTA / Sideload ROMs and Mods on Android What is ADB Sideload? How to Install OTA / Sideload…
  • How To Transfer from iPhone to Android How To Transfer from iPhone to Android
  • How to Connect DZ09 to iPhone or Other iOS Devices How to Connect DZ09 to iPhone or Other iOS Devices

Recent Posts

  • Best Triple SIM Android Smartphones Best Triple SIM Android Smartphones
  • List of DZ09 Smartwatch Phone Secret Codes List of DZ09 Smartwatch Phone Secret Codes
  • How to Change Clock Face on DZ09 Smartwatch How to Change Clock Face on DZ09 Smartwatch

Latest Video

Find us on Facebook

Gizmo Advices Facebook Page

AMAZON PRIME DAY DEALS!!!

Amazon Daily Deals Banner

This page may contain affiliate links so we earn a commission. Please read our affiliate disclosure for more info.

  • About Us
  • Contact Us
  • Affiliate Disclosure
  • Privacy Policy
  • Sitemap

Copyright © 2021 Gizmo Advices | All Rights Reserved

This site uses cookies to deliver services and provide best experience. By using our site, you acknowledge that you have read and understand our Privacy Policy and agree to the use of cookies.

X