[Hero, G2 Touch General] btdag:
This guide was originally written by ante0 on VillainROM.co.uk. For the original click here. Due to some people having issues accessing VillainROM's website I have asked ante0 to give me permission to post the guide here. He happily obliged so thanks go to ante0 for this guide! :)

All I have done to it is change the layout and remove any unnecessary text.

Tools needed:

Android SDK

HTC Sync 3.0.5387 - get the latest if this is old

WinRAR - to extract Android's SDK files

Patience and time

1. Getting ADB (Android Debug Bridge)

ADB is a part of android's SDK. It can be obtained here. Please get the latest Windows version.

Next we need to "install" it.

This is done by simply extracting it to your hard drive:

Install WinRar, then right click on the zip file and choose "extract to".

I chose C:\ as the folder in the zip is named "android-sdk-windows", so you can find the files in C:\android-sdk-windows

After that is done we are now done with the "installing" part.

2. Setting up environment variables - access adb from outside of \android-sdk-windows\tools directory in a command prompt

Now that we have extracted all files we need to set up Windows environment variables to make our lives easier.

I always do this, because it saves you having to cd C:\android-sdk-windows\tools every time you load a cmd prompt.

Windows XP:

Right click on "My computer" and select "Properties"

Click on the "Advanced" tab in the box that appears, looks like the pic below.

Click on the button named "Environment Variables".

Now, double click on the text entry named "Path" in the lower list box

At the end of it, add ";C:\android-sdk-windows\Tools"

(";" is required at the start so windows knows it's a new entry.)

Click on OK to exit out of the dialog, then OK again to get out of My computer's properties. After you reboot your computer you'll have it set up.

Windows 7/Vista:

Right click on "Computer" and select "Properties"

In the System window that appears click on "Advanced System settings" located in the left list

Click on the Advanced tab in the box that appears, then on the "environment variables" button.

Double click on "Path" located in the lower list box.

At the end of it, add ";C:\android-sdk-windows\Tools"

(";" is required at the start so windows knows it's a new entry.)

Now click on OK, then OK again to exit. Restart and all will be set up.

3. Making sure USB works

(original guide linked to my old driver guide - here are new details)

Install the very latest version of HTC Sync - 3.0.5387 is the latest at time of writing but get the latest if this is old

This should install the correct drivers regardless of whether you're on 64-bit, 32-bit, Vista, 7 or XP.

4. Using ADB

(unedited)

I won't list all commands you can use here. I will only list some examples...

Remember to plug your phone in your usb cable (I've forgotten sometimes... lol)

Start by opening a command prompt.

This is done by opening up the startmenu then click on "Run..." (Alternative way: Windowskey + R).

In the "Run..." box, enter "cmd" without quotes.

If you have some knowledge of using a cmd prompt you don't need to read the next part.

To navigate you mainly use the commands CD and DIR.

Here's an image of what it looks like

C:\Documents and settings\jwork> tells you what your current working folder is.

To get out of it, use the command "cd ..".

This will go back one folder, so your new location will be C:\Documents and settings>

One more "cd .." will take you to C:\.

Now, lets say you have a folder named Images in C:\. To enter it you use "cd Images".

If you want to list all files in that folder, enter the command "dir".

Now you might have a image named image01.jpg in that folder, that you want to get to your phone.

Use the command adb push image01.jpg /sdcard/

It should notify you now if the push was successful.

You can check if the image is on your sdcard by using the command "adb shell ls /sdcard/".

That should conclude this guide...

One more thing, if you just enter "adb" it will show a list of all commands with descriptions.

Any questions? Just post here.