Register

Basic commands for newcomers to ADB

This is a discussion on Basic commands for newcomers to ADB within the Galaxy Nexus FAQ & Guides forums, part of the Galaxy Nexus Support Forum category; This is a re-post of a thread I wrote over on the Xoom Forums. I browsed the web looking for all the ADB commands I ...

+ Reply to Thread
Results 1 to 9 of 9
Like Tree7Likes
  • 7 Post By fish1552

Thread: Basic commands for newcomers to ADB

  1. #1
    Super Moderator
    Member #
    116
    Liked
    537 times
    Twitter
    fish1552
    Join Date
    Oct 2011
    Location
    Savannah area of Coastal Georgia, USA
    Posts
    2,515

    Basic commands for newcomers to ADB

    This is a re-post of a thread I wrote over on the Xoom Forums. I browsed the web looking for all the ADB commands I could find and made up this list and included some examples of what gets typed to help people understand how to use it. I was new to ADB when I wrote this (I usually used RSDLite on the OG Droid), so it hopefully can help other newcomers get comfortable with it. Out of many of the tools out there, ADB can help get you out of a pinch if you mess something up, sometimes even when Odin cannot.
    --------------------------------------------------
    Basic commands for newcomers to ADB

    **If a line of code includes <xxx> in the first line, then a second line in RED, the second line is an example to help you better understand the format.

    ADB stands for "Android Debug Bridge". It comes with the android sdk and can be run from the windows command prompt or a mac/linux terminal. For instructions on setting up ADB, please see the thread on how to set up ADB. In order to run ADB from your machine, you will need ensure the following in your Android device "Settings" is set:
    Settings -> Application Settings -> Development -> Then check the "USB Debugging" box.

    To open a command window/terminal, in Windows go to Start > Run and type "cmd" (no quotes). Prior to using any of these commands, you will need to change the directory to the ADB folder on your machine. If using the default install location for the
    Windows install, this would be C:\android-sdk-<machine-platform> and either the /platform-tools or /tools sub-directory, depending which one you copied all the files in. In this example I used the tools sub-directory on a Windows PC.
    Code:
    cd C:\android-sdk-windows\tools
    ** - The "cd" part of the command tells the system to "change directory" to path that follows.

    Command/Terminal Window Tips:
    1) Pressing the "Tab" key will get the previous command entered.
    2) You can also use the right arrow key to repeat the previous command, character by character, which can be a time saver if the following lines all start off the same.

    To see /check devices connected to your system (hit return/enter to run command):
    Code:
    adb devices
    In response, adb prints this status information for each instance:

    Serial number — A string created by adb to uniquely identify an emulator/device instance by its console port number.

    <type>-<consolePort>.

    State — The connection state of the instance. Two states are supported:
    offline — the instance is not connected to adb or is not responding.
    device — the instance is now connected to the adb server. Note that this state does not imply that the Android system is fully booted and operational, since the instance connects to adb while the system is still booting. However, after boot-up, this is the normal operational state of an emulator/device instance

    If there is no emulator/device running, adb returns "no device".

    REMEMBER!!! You must hit return/enter after each command (or line) to run!
    **If a line of code includes <xxx> in the first line, then a second line in RED, the second line is an example to help you better understand the format.

    Pull/Push/Install Apps & Files:
    To install an app:
    Code:
    adb install <path_to_apk> 
    adb install myapp.apk
    To re-install an app, keeping it's data:
    Code:
    adb install -r <path to apk>
    adb install -r myapp.apk
    To push apps from computer to phone
    Code:
    adb push <path to file on phone> <path to location on device>
    adb push test.txt /sdcard/test.txt
    To pull apps from phone to computer
    Code:
    adb pull <path to file on device> <file name for computer>
    adb pull /sdcard/test.txt test.txt
    To clarify the path: In the examples above, the files were placed into the android-sdk/tools folder where ADB defaults to push them, or pull them. So test.txt just means the default path is: C:/android-sdk/tools/test.txt


    Reboot Commands:
    Reboot your device:
    Code:
    adb reboot
    Reboot device into Recovery mode:
    Code:
    adb reboot recovery
    Reboots the device into bootloader mode:
    Code:
    adb reboot bootloader
    Reboots the device into Fastboot mode:
    Code:
    adb reboot fastboot

    View Information:
    Print a list of supported adb commands:
    Code:
    adb help
    Print the ADB version number:
    Code:
    adb version

    Commands helpful in troubleshooting:
    Compile a bug report:
    Code:
    adb bugreport
    Logcat - starts dumping debugging information from your device to the console – useful for debugging (may have to press control+c to exit):
    Code:
    adb logcat
    To output the logcat file to the folder you are running ADB from:
    Code:
    adb logcat > logcat.txt

    Miscellaneous Commands:
    Remount remounts the /system partition as writable (or readonly if it is already writeable):
    Code:
    adb remount
    An example for use would be if you have pulled the framework-res.apk file from your device and want to push it back to the phone, you have to ensure the /system folder is writeable first so that you can push the modified file back to the phone.


    Shell Commands:
    Shell lets you run an interactive shell (command prompt) on the Android device:
    Code:
    adb shell
    Look at the tasks running on your device:
    Code:
    adb shell top
    Check Memory Usage:
    Code:
    adb shell free
    To fix permissions on your device:
    Code:
    adb shell fix_permissions

    Fastboot Commands:
    List devices currently attached to computers:
    Code:
    fastboot devices
    Unlocks a locked bootloader (must be rebooted into bootloader):
    Code:
    fastboot oem unlock
    To flash a Recovery image file:
    Code:
    fastboot flash recovery recovery.img
    Reboot device while in fastboot:
    Code:
    fastboot reboot
    **Boots a ROM stored on your computer specified by the filename**
    Code:
    fastboot boot <filename>
    **Flashes a ROM stored on your computer, partition can be one of {boot, recovery, system, userdata}**
    Code:
    fastboot flash <partition> <filename>
    ** - WARNING: I have not confirmed these last 2 commands work, but included them in case someone ends up here looking for them. Only use them if you know exactly what you are doing as I cannot confirm what it will do.

    More to be added as the thread expands.
    Last edited by fish1552; 01-12-2012 at 11:43 AM. Reason: corrected some grammar
    NewAge, Mujibar, hero and 4 others like this.

  2. # ADS
    Ads


  3. #2
    Super Moderator
    Member #
    116
    Liked
    537 times
    Twitter
    fish1552
    Join Date
    Oct 2011
    Location
    Savannah area of Coastal Georgia, USA
    Posts
    2,515
    reserved

  4. #3
    Milky Way
    Member #
    998
    Liked
    1 times
    Join Date
    Dec 2011
    Location
    New York
    Posts
    39
    I think this definitely deserves to be stickied.

  5. #4
    Rescue Squad
    Member #
    40
    Liked
    327 times
    Join Date
    Sep 2011
    Location
    Hellinois
    Posts
    2,269
    Yeah fish, sticky your own guide already
    -Stephen
    Need Help? Don't panic (yet) Call the Rescue Squad!

    "On Sheep, Wolves, and Sheepdogs"

  6. #5
    Sirius
    Member #
    1127
    Liked
    60 times
    Join Date
    Dec 2011
    Posts
    397
    Pretty fishy...good guide tho
    ~পরিব্রাজক~

    He who desires but acts not, breeds pestilence.- W. Blake

  7. #6
    Super Moderator
    Member #
    116
    Liked
    537 times
    Twitter
    fish1552
    Join Date
    Oct 2011
    Location
    Savannah area of Coastal Georgia, USA
    Posts
    2,515
    Quote Originally Posted by bhfd64 View Post
    Yeah fish, sticky your own guide already
    I did after the original reply (you must have ninja-ed this) and per the other discussion, but I was originally gonna leave that up to other staff. I just don't like to do that to my own stuff.

  8. #7
    Administrator
    Member #
    7
    Liked
    1736 times
    Join Date
    Aug 2011
    Posts
    16,051
    Would you like to unstick it so that someone else can?

  9. #8
    Super Moderator
    Member #
    116
    Liked
    537 times
    Twitter
    fish1552
    Join Date
    Oct 2011
    Location
    Savannah area of Coastal Georgia, USA
    Posts
    2,515
    Quote Originally Posted by Mujibar View Post
    Would you like to unstick it so that someone else can?
    LOL No, it's just a personal thing, that's all.

  10. #9
    Administrator
    Member #
    7
    Liked
    1736 times
    Join Date
    Aug 2011
    Posts
    16,051
    I was just pickin' on ya.

    Tap'd from my GNex

 

 

Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Android Spell Checker Missing Basic Words
    By JG_in_SB in forum Galaxy Nexus General Discussion
    Replies: 0
    Last Post: 01-08-2012, 12:00 AM
  2. Replies: 12
    Last Post: 12-13-2011, 09:32 PM

Search tags for this page

adb commands for galaxy nexus
,
adb commands galaxy nexus
,
adb commands on galaxy nexus
,
adb fix permissions
,
adb galaxy nexus commands
,
adb mode galaxy nexus
,

adb pull galaxy nexus

,

adb pull/push in galaxy nexus

,
adb push command into ram
,

galaxy nexus adb commands

,
galaxy nexus adb guide
,

galaxy nexus adb mode

,

galaxy nexus adb shell

,
list of galaxy nexus command prompt
,
push folder to galaxy nexus adb
Click on a term to search for related topics.