FORUMS
Remove All Ads from XDA

[GUIDE] ADB - Usage, Tips, Tricks and More!

499 posts
Thanks Meter: 197
 
By biggem001, Senior Member on 4th January 2012, 07:28 AM
Post Reply Email Thread

*****To all newebies(as quite a few new people are at this forum because they got their first device! (TFP)) any anyone who wants to learn, let’s get educated about our devices!*****

ADB (Android Debug Bridge) is an extremely useful tool that WILL help you in all of your customizing needs! You may see the need to use ADB commands to help root your device, change ROMS, or send your device a fix. Without the knowledge here, you could easily be left in the dark.

ADB is a necessity for developers and general consumers alike. Knowing this tool is a great advantage to you to help your device at the best quality possible.

Installation
  1. Download Google SDK
    Choose the correct operating system and install!
  2. The installation REQUIRES Java JDK which can be downloaded from Here
  3. If during installation it asks for JDK (and you have installed it) Press the back button and next again, sometimes that will fix the error.
    **Note** The SDK installs to C:\Program Files (x86)\Android\android-sdk standard, chose any directory for you
  4. Start the SDK and immediately, you will notice a few checkboxes. For the standard user, just make sure Android SDK Platform-tools (under Tools) and Google USB Driver package (under Extras) – the drivers are always good to have, latest ADB drviers.
  5. Click install 2 packages and wait. Once installed go to your installation directory and find the platform-tools folder. This directory is your ADB and will be your lifeline!
**Do you want ADB accessible through any command prompt directory?**

You are in luck. (For Windows 7)

Right click on My Computer > Properties > Advanced System Settings >Advanced (Tab) > Environment Variables > Under System Variables scroll and dbl click on Path
TO THE END of the Variable value line add
Code:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Or whatever the directory you installed to + platform-tools

Open CMD and type ADB, if you did it right, you will see proper ADB jargon regardless if you are in the correct directory or not!
Congratulations! ADB is installed!

**Make sure your device is using the latest drivers (that you just downloaded) or other ADB drivers provided by ASUS to access ADB. When connected in Debugging mode, device manager will have: ASUS Android Composite ADB Interface**

ADB Usage

**I will be talking mainly about commands/arguments that the general end-user may use or come across**

**Make sure your tablet is in USB Debugging Mode to be able to connect to ADB (Settings > Applications)**
  • ADB Devices : This command shows all connected android devices that will respond to an ADB command. It is useful for making sure your device is connected.
  • ADB Connect [IP:PORT] : This command will connect to your device over personal WIFI connection if your device is setup for ADB over WIFI (Requires root and NOT recommended)
  • ADB Push [local_file] [remote_file] : This command will push any local file to the device (only if the device is Read/Writable. Stock /system/ folders are only Readable.
  • ADB Pull [Remote_file or Directory] [Save file or Directory] : This command take files or an entire directory and save it to your desired location. This command only works when directory is read/Writable.
  • ADB Shell [command] : This command will perform most UNIX commands on the device. Without a command, you can enter several shell commands before you ‘exit’. Most will not work unless SU is applied (# instead of $). Must be rooted for SU. Only play with these commands if they are known by you or exactly copied from instructions.
  • ADB Logcat [ > file.txt ] : This command will display (or save per > file.txt) a log of what’s happening on the device. If you are receiving errors, turn on logcat, reproduce error, turn off, and send logcat to the developer.
  • ADB Install [-r][-s] [local_apk] : This command force installs (or reinstalls –r or –s installs on SD-Card) any APK provided.
  • ADB Uninstall [-k] [APK_Name] : This command uninstalls any APK Name provided (app.apk) and will even keep cache and other data with the –k tag.
  • ADB start-server : This command will start the server if the server is off or killed. (Normally server will auto-start when ADB command is used)
  • ADB kill-server : This command will close ADB server. Useful if ADB server is acting up or not connecting to any devices.
  • ADB remount : This command will mounts the /system/ partition Read/Writable pending the device is allow to. Stock TFP will NOT.
  • ADB root : This command will restart ADB with root permissions if the build allows for it. Stock TFP will NOT.
  • ADB usb : This command will restart ADB on device to use USB connection for ADB communication.
  • ADB tcpip [port] : This command will restart ADB on device to use TCPIP connection for ADB. Standard port is 5555. Again, this connect not recommended for file transfers.
  • ADB reboot [recovery/bootloader] : This command will restart your device. If either of the two options are given, the device will boot into that mode (sadly TFP does not support the two options.. yet)
ADB Tips/Tricks
  • When following ADB instructions, follow them WORD-BY-WORD in the EXACT ORDER GIVEN. If copy and pasting their commands (one line at a time) makes it easier, then do so.
  • If you have root access, do not mess around in ADB shell unless you know what you are doing
  • Connecting over IP can be beneficial for you for quick ADB access, but for file transfers, speed is slow and you ALWAYS risk corruption (check the md5!) One bad file and you have boot-loops!
  • ADB Logcat is an amazing command. If anything is wrong with your device, 9/10 you can see it in logcat. If you can find the exact problem, fixes can happen much easier. USE LOGCAT TO YOUR ADVANTAGE!
  • ADB reboot can be a quick reboot, sometimes you don’t feel like waiting!
  • Use the environmental variables! It helps exponentially, and keeps from having multiple instances of ADB running.
  • When multiple instances of ADB are running (different directories) ADB can get messed up! (ADB not up-to-date restarts, and connect problems). ASUS Sync service has and ADB setup. Turn it off if you are not using it. Try to stick to only ONE instance of ADB
  • Eventually, we may have root access in our recovery kernel. Then and only then can our devices be truly customizable!


The GUIDE is not finite. Please post anything you feel should be added/corrected to the guide. Please take notice from this, as the understanding of these simple commands could help save your device(s)!
Thanks and 5 star would make me feel good inside too!
The Following 89 Users Say Thank You to biggem001 For This Useful Post: [ View ] Gift biggem001 Ad-Free
 
 
4th January 2012, 07:30 AM |#2  
Senior Member
Flag Pittsburgh
Thanks Meter: 156
 
Donate to Me
More
Wow... Nice post. Lots of time went into this lol. Thanks:) can't give the five stars in the app though:(

Sent from my Transformer Prime TF201 using xda premium
The Following 2 Users Say Thank You to Haro912 For This Useful Post: [ View ] Gift Haro912 Ad-Free
4th January 2012, 05:07 PM |#3  
Lock-N-Load's Avatar
Senior Member
Under Your Skin
Thanks Meter: 385
 
More
The link in step #1 is whack - I think you want tis? http://developer.android.com/sdk/index.html
4th January 2012, 06:13 PM |#4  
OP Senior Member
Thanks Meter: 197
 
Donate to Me
More
Quote:
Originally Posted by Lock-N-Load

The link in step #1 is whack - I think you want tis? http://developer.android.com/sdk/index.html

hmm thats what was in there, i re-saved and it works now ... maybe xda error :P
thanks tho!
4th January 2012, 06:15 PM |#5  
Lock-N-Load's Avatar
Senior Member
Under Your Skin
Thanks Meter: 385
 
More
Quote:
Originally Posted by biggem001

hmm thats what was in there, i re-saved and it works now ... maybe xda error :P
thanks tho!

before you fixed it, it was trying to use this http://http://developer.android.com/sdk/index.html"

note the extra parens at the end and the double http call
4th January 2012, 06:19 PM |#6  
OP Senior Member
Thanks Meter: 197
 
Donate to Me
More
i noticed that too, all i did was re-save and it worked. how weird.
4th January 2012, 09:38 PM |#7  
Member
Flag NYC
Thanks Meter: 5
 
More
Thanks! I've seen a few tutorials on this but this one was by far the easiest to follow and best organized. Short and sweet. Worked on my desktop great, I've never managed to install it right D:
4th January 2012, 10:20 PM |#8  
Senior Member
Flag Pittsburgh
Thanks Meter: 156
 
Donate to Me
More
Wink
Re posting to give 5 stars. Thanks again OP
12th January 2012, 12:23 AM |#9  
Senior Member
Thanks Meter: 19
 
More
Quick question: Is it normal for PTP mode to be required for adb to work? Because as soon as I switch to MTP I can no longer use adb.
12th January 2012, 01:24 AM |#10  
OP Senior Member
Thanks Meter: 197
 
Donate to Me
More
Quote:
Originally Posted by cmat1120

Quick question: Is it normal for PTP mode to be required for adb to work? Because as soon as I switch to MTP I can no longer use adb.

i can do either at once.. thats weird
16th January 2012, 02:52 PM |#11  
Member
Flag Nottingham
Thanks Meter: 9
 
More
Lightbulb GPS, Wifi and BT Testing
Could someone write some basic tutorials on how to verify/test GPS, wifi and BT funtions? For those of us who are new to Android it would helpful in verifying which problems are truly present. Also perhaps show how to find the serial number - for example: some don't know you have to click status - because there are a some erroneous posts out there. There may be users who assume something works or doesn't work, based on limited knowledge and these inaccurate findings only serve to muddy up the works.

There's a lot of animosity about the influx of newbies (and trust me, as a newbie it doesn't feel good). I think the first step is to educate. If some of these troubleshooting steps are laid out, more people can contribute in an intelligent way.

I thought this would be a good thread for the Guides thread, but it is closed and I cannot send PMs.
Post Reply Subscribe to Thread

Tags
adb, guide, transformer

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes