loading...
pCloudy

Executing ADB Shell Commands

bala27 profile image Bala Murugan Originally published at pcloudy.com ・3 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.

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.

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

2. Confirm connection of your selected device

3. The connected device is ready testing

4. Enter ADB shell command to the given text box

5. Execute given ADB shell command

6. ADB shell command execution result


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-bootloader in 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 commands for reference

For more information check out this video:

https://www.youtube.com/watch?v=L5U5dgojNzo

pCloudy

pCloudy is a Unified App Testing Platform for performing manual as well as automation testing on more than 500 mobile devices (smartphones & tablets) hosted on a cloud.

Discussion

markdown guide