Useful ADB Commands to Control Android Device From PC

Here are some useful ADB commands to control your Android device from the command prompt.

To run the adb-commands you have to change to the platform-tools directory in your Android-sdk(/path/to/your/Android-sdk/platform-tools).

Turn Android device ON and OFF. It will toggle device to on/off status.

adb shell input keyevent 26

Reboot device

adb reboot

Unlock device with ADB commands. This is useful in case you forgot the lock screen pattern or password.

First enter into adb shell using the following command

adb shell


Following are the commands to unlock the device from adb. This solution requires a rooted Android device to access its OS settings.

cd /data/data/com.Android.providers.settings/databases
sqlite3 settings.db
update system set value=0 where name='lock_pattern_autolock';
update secure set value=0 where name='lock_pattern_autolock';
update system set value=0 where name='lockscreen.lockedoutpermanently';
update secure set value=0 where name='lockscreen.lockedoutpermanently';
.quit
exit
adb reboot


Configuring Android device for Wi-Fi Debugging

List of connected devices

adb devices

Moving files from desktop to device.

adb push <desktop file path> <device destination path>

Rebooting the bootloader of device

adb reboot-bootloader

Boot to recovery (works only if device supports it)

adb reboot-bootloader

Installing app on device from ADB

adb install <.apk file path on computer>
adb install –k <.apk file path on computer> -> "update app"
adb install –s <.apk file path on computer> -> "install app on sd card"
Uninstalling app from device
adb uninstall <app .apk name>
adb uninstall -k <app .apk name> -> "Uninstall .apk withour deleting data"

Entering text from computer keyboard,

adb shell input text 'enter%stext'

Ebook Download
View all
Learn
View all