Executing ADB Shell Commands on the connected device (2024)

Executing ADB Shell Commands on the connected device (1)

Anshuman Chatterjee | Posted on February 25, 2019September 4, 2022 | 2 min Read

You can fix the issues in your Android phone by connecting it with your computer and writing some easy commands. For this, you will need some command line tools which you can download from the Android developer’s site. If you are using Windows then you will need to visit the manufacturer’s page for your device and download the ADB and fastboot drivers for Windows. But first, let’s understand what are Android shell commands.

ADB is Android Debug Bridge which is a command line utility included with Google’s Android SDK. It provides a terminal interface to control your Android device connected to a computer using a USB. ADB can be used to run shell commands, transfer files, install/uninstall apps, reboot and more. You can also backup and restore your android devices using these commands.

pCloudy also allows you to execute ADB Shell Commands on the connected device to perform mobile testing.

Select your desired device from the list and connect.

Click on “Execute ADB” icon.

While trying to execute ADB Shell command, you just need to follow few simple steps as given below:

1. Select a device from the displayed list

Executing ADB Shell Commands on the connected device (2)

2. Confirm connection of your selected device

Executing ADB Shell Commands on the connected device (3)

3. The connected device is ready testing

Executing ADB Shell Commands on the connected device (4)

4. Enter ADB shell command to the given text box

Executing ADB Shell Commands on the connected device (5)

5. Execute given ADB shell command

Executing ADB Shell Commands on the connected device (6)

6. Android ADB shell command execution result

Executing ADB Shell Commands on the connected device (7)

Executing ADB Shell Commands on the connected device (8)

Useful Android terminal commands:

1. ADB reboot-bootloader and reboot recovery commands:

This command will let you can reboot your device in the bootloader. If due to some malware your device is stuck or if your device is not rebooting then you can connect your device to the computer and run this command to reboot. To run the command just type adb reboot-bootloaderin the command line and to boot the device in recovery just type adb reboot recovery.

2. Fastboot device command:

Fastboot is a diagnostic and engineering protocol that you can boot your Android device into. ADB does not work in the bootloader. If you have to boot into Android and the debugging tools are not active to communicate then you can use the fastboot command. Type fastboot devices in the prompt and you get the serial number.

3. Fastboot unlock command

Fastboot flashing unlock command unlocks your bootloader. This command is not supported in many phones that support fastboot but you can check if your phone supports it. Just type fastboot flashing unlock in the command prompt and hit enter.

4. ADB sideload command:

You can download the update zip file in your phone instead of waiting for the update to be pushed into the phone. To do that just download the update to your computer and connect your device to the computer. Now reboot into recovery on your phone and using the volume buttons choose to apply update from ADB. then open command line and type ADB sideload Full-Path-to-the-file.zip and hit enter.

A lot of users create android shell commands root in a device in spite of security. The adb reboot-bootloader command allows you to boot directly to your phone’s bootloader. Once you’re in the bootloader, ADB shell commands won’t work anymore. That’s where Android ADB fastboot command comes into the picture. Fastboot allows you to send commands to your phone while in the boot loader.

ADB Shell Commands for Reference

Adb Shell commands

Action performed by command

  • adb shell dumpsys batterystats

collects battery data from your device

adb shell ls

list directory contents

adb shell ls -a

do not hide entries starting with

adb shell ls -i

print index number of each file

adb shell ls -s

print size of each file, in blocks

adb shell ls -n

list numeric UIDs and GIDs

adb shell ls -R

list subdirectories recursively

adb shell netstat

list tcp connectivity

adb shell pwd

print current working directory location

adb shell dumpstate

dumps state

adb shell ps

print process status

adb shell am start -a
android.intent.action.VIEW -d

opens browser

adb shell am start-t image/* -a android.intent.action.VIEW

opened gallery

Want to test your Mobile App?

Join pCloudy Platform!

Signup for Free

Related Articles:

  • 7 Types Of Mobile App Testing
  • pCloudy Mobile App Testing Platform – On Boarding Guide
  • App Testing during your Dev Cycle – Developer Tool to Access Real Devices on Cloud
  • Basics of Appium Mobile Testing
  • Selenium Testing For Effective Test Automation
Executing ADB Shell Commands on the connected device (2024)
Top Articles
Latest Posts
Article information

Author: Horacio Brakus JD

Last Updated:

Views: 5786

Rating: 4 / 5 (51 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Horacio Brakus JD

Birthday: 1999-08-21

Address: Apt. 524 43384 Minnie Prairie, South Edda, MA 62804

Phone: +5931039998219

Job: Sales Strategist

Hobby: Sculling, Kitesurfing, Orienteering, Painting, Computer programming, Creative writing, Scuba diving

Introduction: My name is Horacio Brakus JD, I am a lively, splendid, jolly, vivacious, vast, cheerful, agreeable person who loves writing and wants to share my knowledge and understanding with you.