DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 7 1 2 3 ... LastLast
Results 1 to 10 of 68
Like Tree2Likes

Thread: [ HOW TO ] ADB AND WHY I LOVE ADB commands <3

  1. Beta Team
    Flomaster's Avatar
    Member #
    27560
    Join Date
    Jan 2010
    Location
    East Texas
    Posts
    1,073
    Liked
    2 times
    Twitter
    _Flomaster
    Phone
    DROOOOOOOOOOOiid
    Premium Member
    #1

    [ how to ] adb and why you will love it <3

    I haven't seen a simple ADB COMMANDS tutorial here so here it goes


    Motorola Drivers: if you don't have it installed already get it here:
    USB and PC Charging Drivers - Motorola USA


    First you need the Google's Android SDK download it here:
    Android SDK | Android Developers
    put the contents of the zipped file in C:/android/
    it should look like this:

    Now, set your PATH environment variable by right click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path under System Variables. at the end of the line add a semicolon then the full path to the tools directory to the path, in this case, it is: C:\android\tools
    Then click OK , OK , OK.

    I am running Win7 so XP and vista might look a bit different:






    Make sure you have USBDebugging checked on your phone:
    Menu>settings>Application Settings>Development>USB DEBUGGING


    The long drawn out way to Mount your system
    To Mount as Read-Write:
    JUST FOUND OUT ABOUT THIS AND IT DOESN'T REQUIRE A SCRIPT
    Code:
    adb remount
    OR THE LONG WAY
    Code:
     mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
    To Mount as Read-Only
    THE LONG WAY
    Code:
    mount -o ro,remount -t yaffs2 /dev/block/mtdblock4   /system
    IT GOT OLD QUICK

    I found out about scripts and found a couple to make my life easier (down load the attached zip and push to the same directory you have busybox installed /system/xbin OR /system/bin/)
    **use the mount command above in order to do this.**


    sysrw = mounts the system as read-write
    and
    sysro= mounts the system as read-only

    then came root explorer great it mounts for you and makes copying files easy,
    but then I ended up connecting to the computer,
    clicking mount USB
    copy files to sdcard ,
    unmount USB,
    copy file from the sdcard to the Droid.
    blah time consuming and since my usb was already connected why not use the ADB....

    well with the ability to ADB PULL / ADB PUSH I can quickly and easily move files from the droid to the pc or sdcard with ease.

    Commands:

    change to android tools directory: its a good idea to keep it simply mine is located in c:/androind/tools
    Code:
    cd c:android/tools/
    now you can run your ADB commands

    Mount the system as Read-Write:
    this will mount your system as Read-Write using the script you placed in your /system/xbin/ directory. you can then push and pull files from your DROID
    Code:
    adb shell
    su
    sysrw


    adb pull:
    to be done from the directory your tools are in
    example c:/android/tools/>adb pull

    Code:
    adb pull /system/framework-res.apk framework-res.apk
    this pulled the framework-res.apk from /system/framework/ to your adk tools directory you can make changes to it and push it back


    adb push:
    to be done from the directory your tools are in
    example c:/android/tools/>adb push
    **these are case sensitive so Launcher2.apk does not equal launcher2.apk
    Gmail.apk does not = gmail.apk Phone.apk does not = phone.apk**
    get my drift?
    Disclaimer: when pushing framework-res.apk while not in recovery mode it MIGHT cause boot loops. it doesn't for me, but had for others so if you push framework-res.apk and get boot loops, boot into recovery and push it again.
    Code:
    adb push framework-res.apk   /system/framework/framework-res.apk
    this pushed back the framework-res.apk

    Mount the system as Read-Only
    :
    this will mount your system as Read only and sync using the scripts you placed in /system/bin/ directory
    Code:
    adb shell
    su
    sysro
    Rebooting:
    Rebooting is easy

    to be done from adb shell
    Code:
    adb shell
    su
    reboot
    OR
    Code:
    adb shell
    su
    reboot recovery
    OR
    to be done in tools directory

    c:/android/tools/>

    Code:
    adb reboot
    adb reboot recovery



    Screen Capture:
    to be done from Tools directory
    example
    Code:
    c:/android/tools/>ddms.bat
    to quickly open the screen capture tool type ddms.bat
    click on the image of a phone on the left and click the Device menu then screen cap or press Ctrl+S

    EXAMPLES OF USING ADB TO:

    Boot Animations: download your boot animation and place in tools folder it can be called what ever you want because the file will be be changed when we push it.
    adb shell
    su
    sysrw
    exit
    exit
    adb push thekickassbootanimation-goes-here.zip /data/local/bootanimation.zip
    adb shell
    su
    sysro
    reboot
    you mounted as read-write exited out of abd shell into your tools folder and pushed your oddly named boot animation to /data/local/ and renamed to bootanimation.zip


    Pull a file and push it back:
    I will pull my launcher2.apk change the app drawer handle and push it back with my new app drawer images
    Code:
    adb shell
    su
    sysrw
    exit
    exit
    adb pull /system/app/Launcher2.apk Launcher2.apk
    we pulled launcher2.apk from /system/app/ and name it Launcher2.apk and put it in the tools folder on the computer. make your changes to the apk so you can push it back
    Code:
    adb push Launcher2.apk /system/app/Launcher2.apk
    adb shell
    su
    sysro
    reboot
    I pushed the new launcher2.apk back to /system/app/ mounted the system as read only and sync'd and rebooted.

    Changing Directory from ADB SHELL:
    not you need to have a forward slash in front of the directory
    Code:
    adb shell
    su
    cd /sdcard 
    cd /system/app/
    cd /data/app/
    Now maybe you want to see what files are residing in that directory to do that we we the ls command:
    Code:
    adb shell
    su
    cd /system/xbin/
    ls
    This will return a list of all the files in  the "xbin" directory
    Removing stock Apps: email, corp cal,amazon.mp3
    these reside inside or /system/app/

    Code:
    su
    sysrw
    cd /system/app/
    ls
    this now shows you what apps are inside of there note you need to type the name exactly as displayed as it is case sensitive 
    rm com.Email.apk
    rm com.CorpCal.apk
    sync
    reboot
    Removing left over data from the APKS:
    menu>settings>applications>manage applications
    these will usually start with "com" just type the file name as it is on the droid I did with with my droid on so I could see the file names.
    Code:
    su
    sysrw
    pm uninstall com.motorola.calendar
    pm uninstall com.android.email
    pm uninstall com.android.mms
    *must be done after removing the APK, you will get "Sucess" message after it removed it*
    I can update the OP if I missed some stuff, but im at work and want to get home to my family and enjoy some pints of beer


    -=Jason=-
    Attached Thumbnails Attached Thumbnails [ HOW TO ] ADB AND WHY I LOVE ADB commands &lt;3-sdk.jpg   [ HOW TO ] ADB AND WHY I LOVE ADB commands &lt;3-environmental-settings.jpg  
    Attached Files
    Last edited by Flomaster; 03-31-2010 at 12:29 AM.
    danDroid and CJM like this.
  2. Developer
    adrynalyne's Avatar
    Member #
    18036
    Join Date
    Dec 2009
    Posts
    2,896
    Liked
    4 times
    Phone
    Droidzilla
    DroidForums.net Developer
    Premium Member
    #2
    Nice write up. Very nice.
  3. Beta Team
    thebowers's Avatar
    Member #
    8519
    Join Date
    Nov 2009
    Location
    Iowa
    Posts
    2,548
    Twitter
    dabowerman
    Phone
    Rooted Droid, OC @ 1.1 Ghz
    DroidForums.net Theme Developer
    Premium Member
    #3
    May want to add for pushing framework-res.apk that you would want to do this through recovery. As it tends to cause a boot loop if done with the system running.
    If you like what I do, thanks



    Your can follow me as follows

    @dabowerman - Twitter
    Derek Bower - G+ - this is where I will be @ the most and where stuff gets released first.

    Theming Guides that might come in handy
    Theming Guide for Progress Bar
    Notification Text Color Change (How to)
    Theming Guide for System Text
  4. Master Droid
    loop4zil's Avatar
    Member #
    20893
    Join Date
    Dec 2009
    Location
    Atlanta
    Posts
    743
    Phone
    Old man Droid CM6 - Incognito
    #4
    Thank you for this
  5. Beta Team
    Flomaster's Avatar
    Member #
    27560
    Join Date
    Jan 2010
    Location
    East Texas
    Posts
    1,073
    Liked
    2 times
    Twitter
    _Flomaster
    Phone
    DROOOOOOOOOOOiid
    Premium Member
    #5
    Quote Originally Posted by thebowers View Post
    May want to add for pushing framework-res.apk that you would want to do this through recovery. As it tends to cause a boot loop if done with the system running.
    I will put a disclaimer in there:

    odd I haven't had any bootloops at all when I was changing my "pull down Text" I pulled my framework-res.apk changed the eri.xml file pushed it back sycned and rebooted. when metamorph themes the framework-res.apk it isn't in recovery.


    -=Jason=-
  6. Developer
    adrynalyne's Avatar
    Member #
    18036
    Join Date
    Dec 2009
    Posts
    2,896
    Liked
    4 times
    Phone
    Droidzilla
    DroidForums.net Developer
    Premium Member
    #6
    Something to add:

    Code:
    adb reboot
    adb reboot recovery
    You dont specifically have to be in the shell to do these. I have no idea why I mentioned that. I guess its the commands I use the most.
    Last edited by adrynalyne; 03-17-2010 at 06:07 PM.
  7. Beta Team
    thebowers's Avatar
    Member #
    8519
    Join Date
    Nov 2009
    Location
    Iowa
    Posts
    2,548
    Twitter
    dabowerman
    Phone
    Rooted Droid, OC @ 1.1 Ghz
    DroidForums.net Theme Developer
    Premium Member
    #7
    Quote Originally Posted by Flomaster View Post
    Quote Originally Posted by thebowers View Post
    May want to add for pushing framework-res.apk that you would want to do this through recovery. As it tends to cause a boot loop if done with the system running.
    I will put a disclaimer in there:

    odd I haven't had any bootloops at all when I was changing my "pull down Text" I pulled my framework-res.apk changed the eri.xml file pushed it back sycned and rebooted. when metamorph themes the framework-res.apk it isn't in recovery.


    -=Jason=-
    With MM you aren't pushing and replacing the whole framework file. It may not be an issue with ADB, but if you try it in terminal it will do an instant reboot and never load. Kind of like what some people are seeing when pushing MM themes on ESE53 builds.
    If you like what I do, thanks



    Your can follow me as follows

    @dabowerman - Twitter
    Derek Bower - G+ - this is where I will be @ the most and where stuff gets released first.

    Theming Guides that might come in handy
    Theming Guide for Progress Bar
    Notification Text Color Change (How to)
    Theming Guide for System Text
  8. Beta Team
    Flomaster's Avatar
    Member #
    27560
    Join Date
    Jan 2010
    Location
    East Texas
    Posts
    1,073
    Liked
    2 times
    Twitter
    _Flomaster
    Phone
    DROOOOOOOOOOOiid
    Premium Member
    #8
    Quote Originally Posted by thebowers View Post
    Quote Originally Posted by Flomaster View Post
    Quote Originally Posted by thebowers View Post
    May want to add for pushing framework-res.apk that you would want to do this through recovery. As it tends to cause a boot loop if done with the system running.
    I will put a disclaimer in there:

    odd I haven't had any bootloops at all when I was changing my "pull down Text" I pulled my framework-res.apk changed the eri.xml file pushed it back sycned and rebooted. when metamorph themes the framework-res.apk it isn't in recovery.


    -=Jason=-
    With MM you aren't pushing and replacing the whole framework file. It may not be an issue with ADB, but if you try it in terminal it will do an instant reboot and never load. Kind of like what some people are seeing when pushing MM themes on ESE53 builds.
    ahh I see what you mean, I edited my post with a warning about a possible boot loop.

    -=Jason=-
  9. Master Droid
    Topsy's Avatar
    Member #
    20373
    Join Date
    Dec 2009
    Location
    Rio Rancho, New Mexico
    Posts
    677
    Phone
    Rooted Droid @ 1Ghz
    #9
    I've never had framework-res.apk pushing cause a bootloop, but it will force a reboot if you push it onto a running phone for sure.
  10. Senior Droid
    SoDroid's Avatar
    Member #
    28726
    Join Date
    Jan 2010
    Posts
    219
    Liked
    1 times
    Phone
    Motorola Droid
    #10
    Please don't burn me for this
    I have done many things to my phone but I have found ways of doing them that do not involve ADB Shell. I prefer to not deal with lines of code. But I have found that for somethings, I need ADB. (Here comes the burn part) Where can I download ADB Shell? I searched the forums and everyone just talks about how to use it, not where they got it.

    I assume its apart of the SDK but I do not know.

    -I don't think I've ever felt so nooblike.
Page 1 of 7 1 2 3 ... LastLast

Links

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. How To Use ADB: All Commands and Options
    By alquimista in forum Android Hacks and Help
    Replies: 42
    Last Post: 12-05-2011, 07:00 PM
  2. su commands and superuser permissions
    By jdx in forum Android Hacks and Help
    Replies: 5
    Last Post: 03-01-2010, 11:25 AM
  3. Voice commands?
    By hooknife in forum Android General Discussions
    Replies: 1
    Last Post: 02-02-2010, 06:41 AM
  4. LOVE LOVE LOVE one problem here
    By sterdroids in forum Android General Discussions
    Replies: 9
    Last Post: 12-03-2009, 06:56 PM
  5. Love the phone love the site one ? hooking up usb cable to phone to compy
    By Delirious17 in forum New Member Introductions & Site Assistance
    Replies: 2
    Last Post: 11-27-2009, 05:21 PM

Search tags for this page

adb commands

,

adb pull

,
adb pull directory
,

adb reboot

,
adb shell apk
,

adb shell commands

,
adb su
,

adb sync example

,
how to adb pull
,

how to use adb

Click on a term to search our site for related topics.

Tags for this Thread

Find us on Google+