[Desire General] MatDrOiD:
ADB

What is ADB?

Android Debug Bridge (ADB) is a command-line tool to control your device with a computer. ADB is part of google's free android sdk (android software developers kit). Once it's set up, you are able to modifiy the device's internal memory (what you usually cannot do if you are not s-off) and some other things.​

Installation

Windows:

The Installation for Windows is not difficult. Just download this file here and you will get ADB and fastboot (thx to _thalamus):

http://thalamus.ineige.org/misc/adb_fastboot_win32.zip​

You do not need the whole SDK any more. But in Cyanogenmod Wiki one can find a very good guide to install it (in case you need it):

Howto: Install the Android SDK
​

Linux / Mac:

If you use ubuntu (or linux in general) or mac, you have to do some more work:

Set up ADB and Fastboot on Ubuntu

[GUIDE]Set up ADB and Fastboot on Mac
​

How to use adb?​

Preparations:

Set up your phone for debugging (Settings > Applications > Development > check “USB Debugging”).

Now open terminal (for ubuntu/mac: change to platform-tools folder of android-sdk) and enter

adb shell

Getting logcat to work out problems

adb logcat

Copy & Save the output to a text file.​

Modify /system partition:

When you want to modify the /system partition from internal memory, it's recommend to boot into recovery, connect the phone to computer via usb connection and then start adb shell. There is a good guide about adding / removing apps from the /system partition:

[GUIDE]Add/remove system apps​

A complete list of commands for adb shell would blast this guide, so I feel free to refer to the android developers site:

List of adb commands​

There also exists a software for adb: QtADB. Never used it, so I cannot recommend it personally.​

Fastboot

Fastboot is command-line tool to control the filesystem and the firmware (also called radio) of android devices. You access it, when and turn off your phone, and then press and hold first the back and afterwards the power button.​

WARNING:

Flashing filesystems and firmwares is a dangerous thing. When you do not know what you are doing, you can brick your phone. To make sure this doesn't happen, there is a security barrier. This barrier is better known as S-ON, which means “Security on”. If you are in this state, you cannot use fastboot. You have to get S-OFF (Security off) before:

http://alpharev.nl

http://revolutionary.io

To find out wether you are S-ON or S-OFF, boot into fastboot (aka bootloader) and read the first line.

It is also very important to ensure the flashing is not interrupted by power loss or usb disconnections, to avoid your phones gets bricked.​

How do I use fastboot?

Boot into fastboot as guided above, connect your phone to your computer over usb and open terminal, (and change to folder as with ADB). Now you can flash what you want.

fastboot <command> <location of the file you want to flash>

Available commands

Typical partition layout​

Examples:

I assume one is using windows and the stored file is on partition C:\.

fastboot flash hboot C:\hboot.img
fastboot reboot-bootloader
fastboot erase chache

fastboot flash radio C:\radio.img

fastboot flash recovery C:\recovery.img

If you want to flash bootanimation, hboot, radio, recovery or splash, you could use android flasher instead:

[UTILITY]Android Flasher(Rec,splash,Radio,HBOOT,bootanim)(USB-Brick FIX)(12/06/11)

Used it sometimes, never had any problems.​

Reason to flash new hboot

If you decided to use one of alpharev's partition tables, you flash it as a hboot to change the partition sizes of the internal memory.​

Reasons to flash radio via fastboot

First of all, you are s-off. So it's very probable you changed the hboot. When you flash a radio over a recovery, the recovery extracts the downloaded radio.zip into /cache partition. So the radio.img is stored there temporary. For this operation the /cache partition needs as many as 25 mb. If it hasn't, they might occur big problems.​

Furthermore, it's better to do it, because there isn't any software (e.g. recovery) which could go wrong.​

Credits:

rootSU
_thalamus
schiznik