FeaturesGood and EVOTutorials

ADB basics for HTC EVO users

This guest article was written by MildlyDisturbed.

Adb-htc-evo You've probably heard ADB mentioned a few times in the HTC EVO rooting world and may have steered clear because it's yet another tool you could use to shoot yourself in the foot. But it's actually a useful resource you should have (and know how to use) in case you run into problems later down the line and need to debug them.

ADB stands for Android Debug Bridge, and it's a part of the Android Software Developers Kit, which you will need to install first, in all of its huge glory, along with a Java Development Kit in order to use the one little ADB interface.

Basically, ADB is a program that provides many different options. One of these is a command-line interface (shell) for your EVO that allows you to perform file operations such as copy, move, delete, make/remove directories, create links, manage running processes, execute scripts (think batch file), and many other things.

ADB also allows you to see what is happening with your EVO in real time from the white HTC screen all the way through boot up by executing "adb logcat."

Ever wonder why your EVO takes so long to boot? Well, now you can watch each section and wonder why you have PayPal apks on your phone or see that it takes far too long on product X, and kill it. Or if you're wondering what is going on when you get an error "program has crashed," well now you might be able to see that it was trying to open package X.

Another great feature of ADB is the ability to push a file to the EVO from your computer. One time in a masterpiece of disasters, I made a Nandroid backup, realized I was low on space on the SD card, and then moved my backups off the card. I installed a new ROM, it didn't work, and I realized that the Nandroids and other ROMs were on my computer and I couldn't boot to a point where I could mount the phone as a drive. Enter ADB Push, which got another ROM on my SD card without requiring a working phone.

ADB is free and it can be a pain, but it's incredibly useful to have when something goes wrong. You can also use it to put new boot animations on your friends' unrooted phones. Install it today, 'cause when you really need it, waiting 30 minutes for it to download and install is frustrating.

Keep in mind after installing all that software, you'll need to turn on USB debugging on your EVO in order to use ADB. You can do that by tapping Settings > Applications > Development > USB debugging. Then you plug the phone into your computer and open up Command Prompt in Windows or Terminal in OS X. And should you ever tire of having to connect that pesky cable to your EVO, you can get ADB Wireless from the Market and do everything wirelessly.

A complete list of ADB commands is here but I'll go over a few of the more useful/used ones now.

ADB logcat – See what all is happening. You can run this while your EVO is at the white screen, and as soon as the logcat process starts up, you'll be able to watch the boot progress live.

ADB push <source destination here> – Let's say you have a file called C:MY ROMSPC36IMG.zip and you want to push it to the root of the SD Card so you can flash it later. The command to type would be adb push "c: my romsPC36IMG.zip" /sdcard/. ADB pull is used for the opposite (get a file off your EVO); it's generally not something you need to know, though, so I'll skip an example.

ADB install <filename here> – This attempts to install an apk. If you do a lot of rooting and want to set up a batch file to install a lot of your non-Market stuff (direct from vendor), this is a massive time-saver.

ADB shell – The most important command, in my opinion, of the bunch. This allows you command line access to your phone. (You can also do this on your EVO using an app like Terminal Emulator, but using ADB shell has the advantage of being able to use a real keyboard, and it can be done before the phone boots).

For those of you familiar with Linux shells, this is sort of like Android's lesser loved cousin version of it. There're not a lot of command-line commands included with our EVOs. There's a workaround for that I'll go into later, but some of the good shell commands are

  • exit – If you don't know what you're doing, type this and hit enter. If you're done, type this a couple of times.
  • su – This is superuser (if you're rooted) and you'll need it to do some things.
  • top – See the list of running processes.
  • mkdir – Make a directory.
  • rmdir – Remove that directory you just made named "testing."
  • cd – Change a directory.
  • ls – Similar to the "dir" command in DOS.
  • cp – Copy.
  • mv – Move (similar to copy, except it only works on the same device and only leaves the file in the destination folder.

Depending on your ROM, there may be more or fewer commands available. Luckily, most ROMs include a program called busybox. You probably have heard of this in passing or when you installed Titanium Backup, but if you weren't sure what it actually was, it's an executable with a ton of functions built-in. Basically it's Swiss-Army-Linux. You can find a list of commands here.

Busybox has a ton of commands, but one of the most useful when attempting to find where your particular flavor of ROM has stashed stuff is "busybox find -iname <mask>," which will do a search on the SD card and internal memory for that file.  So, assuming someone on another ROM says to change the bootanimation.zip but it's in a different location on your ROM , you can just run "busybox find -iname boot*" to find it.

There are tons of things you can do from the command line. You may never have to use ADB with your HTC EVO, but it's still a useful tool to know.

This guest article was written by MildlyDisturbed.

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Become a patron at Patreon!

Jenn K. Lee

Jenn K. Lee is the founder of Pocketables. She loves gadgets the way most women love shoes and purses. The pieces in her tech wardrobe that go with everything are currently the Samsung Galaxy Note II, Sony Tablet P, and Nexus 7, but there are still a couple of vintage UMPCs/MIDs in the back of her closet.

More posts by Jenn | Subscribe to Jenn's posts

Avatar of Jenn K. Lee

15 thoughts on “ADB basics for HTC EVO users

  • Nice basic write-up. I’m sure you’ll get comments asking for more about installing the SDK to get ADB, how to actually initiate an ADB session, etc. but this is a great primer. Thanks!

  • Avatar of KommodoreHeinz

    Jenn –

    I love ADB Wireless. I have been using it for awhile now, its so much nicer then trying to hunt down the cable every time. Thought it seems to be slightly slower then a cable when moving LARGE files it works great!

    I believe the ADB Wireless it a necessity app for all users.

    Also, when out and about away from a Wi-Fi network you can use the hotspot capabilities of you EVO to connect with ADB Wireless.

  • Avatar of bradleyw801

    Using ADB from your phone with terminal emulators is also a great way to run some of these commands.

    ADB is useful to move around system files and folders, and if you are someone that likes to jump on the development bandwagon early, most of the good “tricks” and features that developers come out with require ADB to get them going, until they package everything in a flashable zip, or they create an app that utilizes busybox.

  • Avatar of seeking contact assistance

    Okay…so I’m a newbie to all this but I do have a major problem that sprint was not able to help me w..*wonders* if this would fix my phone…
    After I installed gingerbread the phone wason the frits..long boot time…error on program all the time…rebooting whn it felt like it..
    The other day everytime I touched the back button phone when to the white HTC screen and reload all my apps, closed. internet browsers…
    I restarted thinkin it would help….epic fail! Phone deleted all my contacts n call history ( granted they are backed up on 2 Google accounts) but nothing shows…
    Attempted manual entrance of contacts, phone states its saved but nothing shows… :( the only time the info is shown is in call history..
    Has this ever happens to anyone? If so is it fixable? Deapretly seeking assistance ……
    Have spent 2 days on the phone w Sprint tech and advanced tech support, upwards of 3-3.5 hrs on the phone w no help….:(

    I’m open to suggestions if anyone cam help…. thanks

  • sure, how about just putting a different rom on it and just move on.

    You will get more support form fellow users than sprint any day.

  • You don’t say if your phone was rooted or if you are unrooted and took the Gingerbread update from Sprint.

    If you are unrooted I would suggest you take the phone to your local Sprint store and see if they can help you.

    If rooted I would suggest you grab a stock rooted ROM from here: http://forum.xda-developers.com/showthread.php?t=1038701 , flash it and see if your issues persist.

  • Avatar of Abraham V.

    Soooo…..does anybody else look at the GoodAndEvo logo and think of a dog before anything else????

    I do. I know it’s random, but thats what I thought it was for the longest time, for some reason.

  • Avatar of seeking contact assistance

    Thank you! Old Evo was rooted. This replacement phone wasn’t rooted b4 this happened :(. Thanks for your suggestion…the only thing store offered was a hard rest…:( still disnr wrk now they have me waiting on an evo ( pretty sure its gonna b a refurbished Evo) cause they are on back.order….the joys whn dealing with Sprint..

  • Avatar of seeking contact assistance

    Not a great help if I can’t unrest tuis pjone..and that will do notiin to restor my contacts. I apreciate the atempt to assist with my issue.

  • If your contacts are synced to google, they will be restored when you sign into your google account on your new phone. Contact syncing is one reason I will be buying another android phone in the future.

  • Avatar of amaults27

    You SOB. Now I can’t unsee it!

  • Avatar of redraiduzz

    really? You can do this with ADB Wireless? How fast does it go or work?

  • yup – cable gets you transfer rates of about 10-20mbit a second if I remember right

    wireless you can push data to the phone at about 5-7mbit and get it at about 1-4 – it depends on range, kernel, etc…

    If you’re pulling a large file off of the evo you want to plug it in, if you’re pushing a large file to the evo you’re not going to notice too much difference unless your evo’s far away from the wireless access point.

    Speed limits on adb wireless are set by how fast you can send / receive. Speed limits on wired are set by how fast your sd card can read/write (I’m assuming the kernel may play a role in this also)

    My understanding of the thing… never benchmarked it though


Leave a Reply

Your email address will not be published. Required fields are marked *