15 Useful Android Terminal (ADB Shell) Commands

by Jeffry on March 10, 2010

While rooting your Android Phone or installing custom ROM on your mobile or partitioning your android device to install applications, requires some android terminal command and ADB (Android Debug Bridge) shell command knowledge. Below is the list of some basic android commands that are being used on Android platform frequently and that every android user must know.
 android adb shell

Basic Android Terminal and ADB Shell Command List

1. How to open a cmd in Android Phone
Method 1: “Start” – “”Program”-” “Accessories” – “” Command Prompt ”
Method 2: “Start” – “” Run “, type cmd ENTER

2. How to restart Android Phone
When the phone and Computer is connected to the data cable, you can enter the following command

[shell]
adb shell reboot === ENTER
[/shell]

3. Restart Android into Recovery Mode
With the data cable connected to your phone and computer, enter the following command

[shell]
adb shell reboot recovery === ENTER
[/shell]

4. Convert back to ext2 partition
Restart the phone into Recovery mode, press “Alt + X” into the console. Open cmd and enter the following command

[shell]
adb shell === ENTER
tune2fs-O ^ has_journal / dev/block/mmcblk0p2 === carriage return
e2fsck / dev/block/mmcblk0p2 === carriage return (optional, can be a problem area in section 2, when used)
[/shell]

5. Pulling applications from Android phone to computer

[shell]
adb pull /system/sd/app app
adb pull /system/sd/app-private app-private
[/shell]

6. Pushing applications back to android phone from the computer

[shell]
adb push app /system/sd/app
adb push app-private /system/sd/app-private
[/shell]

7. Delete existing apps on Android SD

[shell]
adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private
[/shell]

8. Repair gravity System or switch to screen
Sometimes frequent brushing of phone can cause gravity system or switch to screen failure. Just follow the steps below-
Restart the phone into Recovery mode, press “Alt + X” into the console
Open cmd and enter the following command

[shell]
mount / data === carriage return
rm / data / misc / akmd * / data / misc / rild * === ENTER
[/shell]

9. Ext2/ext3/ext4 formatted partition
Enter the following command in the cmd

[shell]
adb remount === ENTER
adb shell === ENTER
rm-r / system / sd / * === carriage return
[/shell]

10. Remove/ system / app under the application
Under normal circumstances / system / app is not under an application. Use the following methods to remove these applications.
Open cmd and enter the following command

[shell]
adb remount === ENTER
adb rm / system / app / Stocks.apk === Enter
[/shell]

11. If the start Time is too Long
Just enter the following command in order to view the boot process.

[shell]
adb logcat === ENTER
[/shell]

12. Through Terminal Partition SD card
It will erase everything on your SD card

[shell]
$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)
[/shell]

13. From the Recovery Screen, send an update file to your SD card.

[shell]
adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip
[/shell]

14. Restoring a nandroid backup via Fastboot
Start command-prompt/terminal cd to the nandroid folder and enter following commands

[shell]
fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot
[/shell]

15. Clear Search History in Android

Search History is accounted for Mobile Memory. It can also leak your privacy information as well. Just follow the steps below to clear android history.

Steps are as follows:

1. Make sure your mobile phone has Root authority.
2. Open the super-terminal.
3. Enter the following command

[shell]
su
rm / data / data / com.android.vending / databases / suggestions.db
[/shell]

4. Exit Hyper Terminal and restart the phone.

If you have a good one to add please post it in comment section

Blog Widget by LinkWithin
  • DEJAN

    How move app to EXT partition, which command is for ADB

  • Pedro Vinicius Villote Paula

    i cant get out from recovery screen! every time i turn my tablet (coby mid7120) on it get on the recovery screen! srry my english :S

  • UtCollector

    Nice but is there a command to make a backup of the recovery.imb/rom from the phone to the pc?

  • http://koowie.com Koowie

    Ah…this is what all geeks want.

  • Joey198209

    can i use this to fix my touch screen? it does not work at all.. and do i have to unroot it? thnx

  • Torres76

    how do i connect command prompt to my phone ???

    • shonangreg

      If you command prompt is of a thin font, then you can just pull up the edge of your screen and slide it under there. Be sure not to slide the command prompt between the screen protector and the screen, you’ll just a make a bubble that way. LOL :-) Likewise, once you’re below the screen, make sure not to slide the command prompt in between the screen and the screen saver. Screen savers do follow commands, but they’re too compliant and can actually become a vulnerability for hacker queues. And you wouldn’t want that ;-O No, you have to connect it all the way down at the source, where the screen interfaces with the video driver. There should be one empty seat down there. Just place the command prompt right next to the driver. He’ll do what he’s told. He’s just a driver, after all.

      I hope this helps. Oh, and if you browse too much porn or FarmVille, then the empty seat next to the video driver might already be occupied by a virtual Taylor Momsen (for Flash) or bags of facebook manure (it is just shit, really). Clean those out first. Command prompts don’t work well in distracting conditions.

      • fferen

        Amazing advice, really helped me wedge that damn command prompt in there good and hard. Question though, how do I get it out now, it’s starting to smell strongly of old socks, and is holding my SD card hostage. Poor thing can’t even move, and the screaming keeps me up nights. :(

        • shonangreg

          You could just stick a pair of extraction tweezers down in there and pull it out. Or you could use a split knife and then shake and dump the pieces of the command prompt out of the speaker hole, but both of these procedures cause big problems with the rest of the system, not to mention the damage you’ll do to the body of the command prompt. As soon as either one of these processes is begun, everything else inside sees what’s going on and goes into a kernel panic! Panicked phones are notoriously difficult to calm down and are often no longer useful, except for calling the police/fire/ambulance. Do not under any circumstances call an old girlfriend with a panicked phone. Better to watch the movie “Fatal Attraction” than to actually live that story our in real life ;-) No, you have to convince the Command Prompt to come out on his own.

          The best way to do this is to convince him that all the others down there with him are humoring him. Make him feel bored and challenged to get out himself. Another movie, The Truman Show, should give you good ideas.

          To endure Command Prompt’s safe recapture after initiating Project Truman, it is best to suspend your phone above a bowl of whipped cream. When he pops out, plop! He lands in the whipped cream and waits there for you.

  • Iconslim

    ATT Captivate does not have the databases folder under com.andriod.vending. Step 2 should read in a command window, type adb shell then from the $ prompt type SU. You’ll receive a notice on the device asking for root permission. Then the prompt changes to #

  • http://www.advancedraidrecovery.co.uk Raid Recovery

    Thanks for lists of these useful codes.

  • http://www.advancedraidrecovery.co.uk Raid Recovery

    Thanks for lists of these useful codes.

  • http://www.advancedraidrecovery.co.uk Raid Recovery

    Thanks for lists of these useful codes.

Previous post:

Next post:

Gadgets DNA | About us |  Copyright Policy |  Privacy Policy |  Disclaimer |  Subscribe us |  Contact us |  RSS Feed |  Sitemap