1. Download our Official Android App: Forums for Android!

Apps [HOW TO] Basic ADB Commands

Discussion in 'Android Development' started by t0ast3d, Aug 30, 2010.

  1. t0ast3d

    t0ast3d Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    73
    Posts:
    372
    Joined:
    Aug 27, 2010

    Aug 27, 2010
    372
    76
    73
    Student / Dev
    Oklahoma
    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

    ^ I believe there is a sticky right below/above this thread on how to do so ^


    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) -- cd /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.

    Hope you learned something!
     

    Advertisement

  2. osirusrising

    osirusrising Newbie
    Rank:
    None
    Points:
    15
    Posts:
    14
    Joined:
    Jun 22, 2010

    Jun 22, 2010
    14
    0
    15
    Director of Technology and Software Engineering De
    DFW Metroplex
    Good Post, however how would one be able to possibly create an APK which just copies a folder or folders with files in them to the SD card under a specific location. I'm working on a Theme deployment with DreamLyfe and trying to tie in the files and folders in an APK. I have experience wit hthe ADB and it's nice, but need to fig out how to assemble in SDK.
     
  3. jiminaus

    jiminaus Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    190
    Joined:
    Oct 27, 2011

    Oct 27, 2011
    190
    36
    63
    Sydney, Australia
  4. johnny424

    johnny424 Android Expert
    Rank:
    None
    Points:
    183
    Posts:
    1,501
    Joined:
    Nov 2, 2011

    Nov 2, 2011
    1,501
    466
    183
    HVAC Sheetmetal Mechanic/ Service Tech
    Washington Dc
    nice post..i am still learning and searching for useful things..even though im a few months late : ) ..thanks again for insightful info
     
  5. chadb740

    chadb740 Member
    Rank:
    None
    Points:
    36
    Posts:
    37
    Joined:
    Jan 1, 2012

    Jan 1, 2012
    37
    1
    36
    Please post many more commands.
    After Eclipse is installed, where do I find a list of commands that are used to program?
    I've go Eclipse, SDK/AVD manager installed.
    What are the commands used to write a program?
    My searches all turn up empty.
    Is there a place that has all of the java commands?
     
  6. jiminaus

    jiminaus Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    190
    Joined:
    Oct 27, 2011

    Oct 27, 2011
    190
    36
    63
    Sydney, Australia
  7. reggjoo

    reggjoo Well-Known Member
    Rank:
    None
    Points:
    38
    Posts:
    229
    Joined:
    Jan 25, 2011

    Jan 25, 2011
    229
    19
    38
    Male
    Pgh
    I using QtADB, A gui representation of ADB, what can I do with that? Most of the first post, is there, in a gui.
     
  8. droidbot45

    droidbot45 Newbie
    Rank:
    None
    Points:
    15
    Posts:
    12
    Joined:
    Mar 28, 2012

    Mar 28, 2012
    12
    0
    15
    Thanks for the turorial
     
  9. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator
    Rank:
     #42
    Points:
    633
    Posts:
    4,494
    Joined:
    May 2, 2012

    May 2, 2012
    4,494
    3,159
    633
    Male
    Student
    USA
    Another idea is to add the sdk path to your PATH variable per the instructions here: Installing the SDK | Android Developers
     
  10. gsx1000r02

    gsx1000r02 Member
    Rank:
    None
    Points:
    18
    Posts:
    71
    Joined:
    May 30, 2011

    May 30, 2011
    71
    15
    18
    My phone is not rooted and one of my apps I have to log in to to use and I canny remember my pwd. I don't want to reinstall and lose all my settings. Is there any way I can use adb to get my password back?
     

Share This Page

Loading...