FORUMS
Remove All Ads from XDA

Gunnyman's quick and dirty adb/fastboot primer

7,998 posts
Thanks Meter: 2,698
 
By gunnyman, Senior Member on 6th July 2012, 12:07 AM
Post Reply Email Thread
I see there are a lot of users here in these forums that either are scared of ADB or have no idea how to use it or what to do with it.
The beauty of ADB is it's cross platform, it works on Windows, Mac, and Linux.
The adb commands everyone should know how to use are very basic and used for file manipulation and device control.

To use ADB Google will tell you you need to download and install the most current Android SDK. If you want to write apps for Android, this is true, but for most people there's no need to do this.

You can get everything you need from one of the one clicks.
You need adb and fastboot for your platform.
Download them and put them in a directory of your choice, on my Mac they live in /Android.

I've dug them up and attached adb and fastboot for all platforms. Just unzip them and put the ones for your Operating System somewhere easy to get to.

if you're on Windows you'll need drivers. The best way to get the driver is to download HTC Sync from here http://dl4.htc.com/managed-assets/su...tup_3.2.20.exe and install it. After it is installed make sure it isn't running.

I'm now going to go through a few simple adb command and what they're for.
To use ADB or Fastboot your phone has to be in USB Debugging mode Set this in Settings/Developer Options on the phone.
Open a Command prompt
Navigate to the location you put the adb and fastboot commands


1) adb reboot
this command does exactly what it says. If you type it without any modifiers your phone will reboot. You can also reboot recovery or reboot bootloader.

2) adb push
Adb push is the command for putting a file on your device.
The format to use the command is adb push /filelocation/filename /destination the destination is usually /sdcard

3) adb pull
this command is how you get a file off of your phone
adb pull /file location the file will be downloaded to the location of your adb executable

4) Sometimes to help you troubleshoot a problem you may be asked to provide a logcat to someone. What this means is a log of the what is happening on the device. Getting one is easy
adb logcat > logcat.txt
this will create a logcat file and save it to the directory on your computer that you're running the adb commands from. To stop the logcat just use ctrl-c


Now on to fastboot
fastboot is a special mode on Android phones that allow system level partitions to be written or commands executed.

fastboot only works if your phone is in bootloader mode.
Once in bootloader mode
open a command prompt and navigate to where you installed the fastboot executable

You need fastboot to unlock your bootloader
fastboot flash unlocktoken Unlock_code.bin

and to relock it:
fastboot oem lock

you can also use fastboot to flash recoveries
fastboot flash recovery recovery.img use the filename of the recovery you downloaded.

If you've installed the 2.20 firmware from AT&T and you have root, you'll need to flash the kernel for any new rom separately using fast boot.
unzip the rom you've downloaded and locate the boot.img file and put it in the same directory as your fastboot and dab commands
reboot to bootloader then flash the kernel using the command fastboot flash boot boot.img. after hat you can boot into recovery right from the bootloader and install your rom.

These commands are just a few very basic ones.
There's no reason to be afraid of the command line or these tools.
I hope this quick and dirty tutorial helps someone.

If there's something else that can be explained here, feel free to add it to the thread and I'll add it to the OP.
Attached Files
File Type: zip adb-fastboot.zip - [Click for QR Code] (645.5 KB, 4154 views)
The Following 68 Users Say Thank You to gunnyman For This Useful Post: [ View ] Gift gunnyman Ad-Free
 
 
6th July 2012, 12:19 AM |#2  
Pirateghost's Avatar
Inactive Recognized Developer
Thanks Meter: 8,859
 
Donate to Me
More
you're right. nobody should be afraid of adb/fastboot commands or understanding WHY they are useful.

i would as far to say that if you dont understand basic adb/fastboot commands, then you have no business modding your phone....
The Following 3 Users Say Thank You to Pirateghost For This Useful Post: [ View ] Gift Pirateghost Ad-Free
6th July 2012, 12:37 AM |#3  
_MetalHead_'s Avatar
Senior Member
Flag Portland
Thanks Meter: 2,803
 
More
You gotta add that they need to open a command line from the directory that has adb in it and type the commands from there.
The Following 3 Users Say Thank You to _MetalHead_ For This Useful Post: [ View ] Gift _MetalHead_ Ad-Free
6th July 2012, 12:44 AM |#4  
gunnyman's Avatar
OP Senior Member
Flag Greenville SC
Thanks Meter: 2,698
 
Donate to Me
More
Quote:
Originally Posted by _MetalHead_

You gotta add that they need to open a command line from the directory that has adb in it and type the commands from there.

Oh yeah, duh
6th July 2012, 12:48 AM |#5  
_MetalHead_'s Avatar
Senior Member
Flag Portland
Thanks Meter: 2,803
 
More
Quote:
Originally Posted by gunnyman

Oh yeah, duh

You're slackin'
6th July 2012, 01:10 AM |#6  
RofSpark's Avatar
Member
Thanks Meter: 14
 
More
I would go so far to say that this lack of comfort with adb/fastboot is the single largest contributor to the issues people have had in rooting and unlocking their HOXs over the last two months. Thanks for taking the time to put this together. Should help quite a few people unsure of adb/fastboot in general.

Another adb usage that may be helpful to add to this list is adb pull of user apps before updating ROM and then pushing them back. I have often seen people unsure of the best way to restore apps after a ROM upgrade. For me TiB works great, but you need to know what to restore via TiB and what to configure again manually. I think Scott posted the general steps in one of his CleanROM threads, but adding it to this list would be good too.

Just realized it's exactly two months since I received my pre-ordered HOX . No bricks, a superb HOX that I haven't had to warranty replace for any reason so far, and then comes along Scott with his fantastic CleanROM series. What a fun-filled ride it has been so far
The Following 2 Users Say Thank You to RofSpark For This Useful Post: [ View ] Gift RofSpark Ad-Free
6th July 2012, 01:38 AM |#7  
rohan32's Avatar
Retired Forum Moderator / Retired Recognized Developer
Flag New Jersey
Thanks Meter: 5,071
 
Donate to Me
More
Add adb logcat as well please, not enough people know how to use it
The Following User Says Thank You to rohan32 For This Useful Post: [ View ] Gift rohan32 Ad-Free
6th July 2012, 01:46 AM |#8  
zounduser's Avatar
Senior Member
Flag sioux falls SD
Thanks Meter: 1,940
 
Donate to Me
More
nice bro! this will come in handy for those that need it. i was there once! we all were. but good job man!
6th July 2012, 01:46 AM |#9  
gunnyman's Avatar
OP Senior Member
Flag Greenville SC
Thanks Meter: 2,698
 
Donate to Me
More
Quote:
Originally Posted by rohan32

Add adb logcat as well please, not enough people know how to use it

Good call. Tomorrow I'll update it.
6th July 2012, 03:07 AM |#10  
gunnyman's Avatar
OP Senior Member
Flag Greenville SC
Thanks Meter: 2,698
 
Donate to Me
More
Done. Keep the suggestions coming. I know enough to get someone started, but I'm no developer.
The Following User Says Thank You to gunnyman For This Useful Post: [ View ] Gift gunnyman Ad-Free
6th July 2012, 05:08 AM |#11  
WTFunk's Avatar
Senior Member
Flag New York
Thanks Meter: 96
 
More
I like this. Information that won't get old and everyone needs at one point or another. Nice call gunny.

Stickify!
The Following User Says Thank You to WTFunk For This Useful Post: [ View ] Gift WTFunk Ad-Free
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes