1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

(How To) ADB commands

Last Updated:

  1. t0ast3d

    t0ast3d Well-Known Member

    If you find this helpful or think it would be helpful to others, tip it for a sticky!

    Here's a little guide I put together for you to learn basic adb commands.

    I'm posting this thread assuming you already have your SDK set up

    With that said, let's dive right in!

    1. Turn on ADB

    Go to Menu > Settings > Applications > Development > USB Debugging

    2. Running ADB

    Open up command prompt and type your way to the directory you have your SDK in.

    Mine is in C:\

    So for example, mine would be: cd c:\AndroidSDK/tools

    You are now in

    3. Basic ADB commands

    ADB push (sends files to your phone) -- adb push c:\example.apk /sdcard/example.apk

    ADB pull (Receives files from your phone) -- adb pull /system/app/example.apk c:\example.apk

    ADB install (installs application) -- adb install c:\example.apk

    adb shell (Begins shell connection with phone)

    adb reboot (reboots phone)

    adb reboot recovery (reboots phone into recovery)

    adb reboot bootloader (reboots the phone into bootloader/the white screen)

    adb remount (remounts the system)

    4. Commands to run while in ADB Shell

    cd (changes directories) -- cd /system/app

    ls (lists all files in the directory) -- ls /system/app

    rm (removes files) -- rm /system/app/example.apk

    cp (copies files) similar to cat -- cp /system/app/example.apk /sdcard/example.apk

    cat (copies files) -- cat /system/app/example.apk > /sdcard/example.apk

    exit (exits shell) -- exit

    Might add a little more later if requested/clean it up

    Hope you learned something!

    vishalzyy, benny3, ndh777 and 5 others like this.
  2. pinoy724

    pinoy724 Well-Known Member

    I vote to sticky. :D Great for noobs. I'm sure more commands will be posted after a few hours.
  3. novox77

    novox77 Leeeroy Jennnkinnns! VIP Member

    cp doesn't exist with the default shell. It becomes available if you install busybox. But then you get a ton of other common shell commands as well. A lot of ROMs come with busybox now, but not all.

    Thanks for doing a tutorial :)
  4. t0ast3d

    t0ast3d Well-Known Member

    Yeah, but most if not all the mainsteam ROMs have it.

    No problem.
  5. Hazy

    Hazy Well-Known Member

    Is there a command to check the current cpu frequency?
  6. t0ast3d

    t0ast3d Well-Known Member

    Use SetCPU from the market.
  7. EdAndInn

    EdAndInn Well-Known Member


    The ADB server is A server a background process on your development machine - e.g. Windows PC. The ADB server manages communication between the client and the adb daemon running on an emulator or device. The ADB commands that are essential to start ADB Server and connect to Device are:

    Terminates the adb server process that is running in the background

    ADB kill-server

    Check whether the adb server process is running in the background. Start it if it is not running in the background:

    ADB start-server

    Know what emulator/device instances are connected to the adb server. Generate a list of attached emulators/devices:

    ADB Devices

    This command produces Device/Emulator serial number and itis state - whether online or offline.

  8. EdAndInn

    EdAndInn Well-Known Member


    If one wants to debug or see behind the scenes what an App is doing, then use following ADB Commands:

    ADB logcat > /sdcard/adblogcat.txt

    Run the App that you want to debug on the Phone

    When done, press

    Ctrl + c

    ADB pull /sdcard/adblogcat.txt C:\adblogcat.txt

  9. beastinbolts

    beastinbolts Well-Known Member

    I have not used adb at all but do have sdk and the like ready to go I set it all up when trying to push a bootanimation just to find out that my hboot version ( 2.10 ) does not support this.. I wondering if I can still use shell commands or do a pull or install with adb
  10. 9to5cynic

    9to5cynic Well-Known Member

    I'm gonna have to try this to logcat
  11. Helloiii

    Helloiii New Member

    You said your way to the directory to sdk is cd c:\AndroidSDK/tools ........................how come .What is cd supposed to be here ?

    I mean basically shouldnt it be c:\"installation folder" or c:\program files\"installation folder"
  12. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!! Moderator

    you do not have to have cd in front. unless you are in a different directory. the whole idea is that you point the command in the right path. so that where ever your adb folder is at that is where the command should be.

    i find that if you right click while holding down shift and select open command window here option (only works in windows 7) to be the easiest way.
    Robobob1221 likes this.

Share This Page