[G2 and Desire Z Android Development] steviewevie:
INSTALLING ADB ON MAC

The following excellent guide kindly provided by siedkins, please thank him and not me !

What you will need:

A Mac

USB cable

Android SDK for OSX- http://developer.android.com/sdk/index.html

At the time of writing this the version was "android-sdk_r08-mac_86" so please have a look at the above link and let me know if you can't find that same version.

So download the zip file and I would extract it to a folder where you are happy to keep it such as within your user home folder i.e. Macintosh HD/Users/{Your User Name} and for my mac it is Users/siedkins which is how I have my OSX set up.

Then open then still in Finder, open "android-sdk-mac_86" then "tools".

Now launch Terminal - ⌘ + space then type Terminal or Applications>Utilities>Terminal

Now drag and drop the file called "android" in the "tools" folder into your terminal window and you should see something like:

/Users/siedkins/android-sdk-mac_86/tools/android

Then hit enter - this should load Android SDK

Next go to Available Packages on the left and Android Repository > Android SDK Platform-tools, revision 1 -tick the box and hit "Install Selected"

It should download and install the Platform Tools which includes ADB !!!!

Now quit Android SDK after it has downloaded and go back into Finder. Now you should see a new folder "platform-tools" in the "android-sdk-mac_86" folder. Open that and you can now see a file called adb.

Now .... I am going to show you how to make your life a lot easier in Terminal to run ADB without having to navigate to the folder every time you want to launch it.

Go back to your Terminal window and type (or copy & paste):

cd ~

The screen should then look like

NAME_OF_YOUR_MACHINE:~ USERNAME$

For me I have:

Mac-Pro:~ siedkins$

Next, type

touch .bash_profile

to create your new bash / path file

Next, type

open -e .bash_profile

to open it in TextEdit.

Now into Text Edit please copy:

export PATH=${PATH}:

Then go into Finder and navigate your your "android-sdk-mac_86" folder. Then click on the "platform-tools" folder and drag and drop this into TextEdit at the end of the code above that you copied. Mine looks like:

export PATH=${PATH}:/Users/siedkins/android-sdk-mac_86/platform-tools/

Yours should look like:

export PATH=${PATH}:insert your path to the "platform-tools" folder in your Android SDK here

All you need is that one line. Then Save and exit TextEdit and then very importantly QUIT TERMINAL.

Now ........ to turn on USB Debugging in your handset Settings > Applications > Development > USB Debugging - ticked and also go to Settings > Connect to PC > Default connection type > Charge Only and also UNTICK "Ask me ..." there also. You can always go back here and change these settings back.

Now plug in your phone to a USB port. I noticed that if I plugged my phone into one of the standard USB ports on the front of my machine I couldn't see the phone further down the line and if I plugged it into a powered USB port on the front (I have an "akasa AK-ICR-08" which has a powered connector behind the 5 USB ports. But you guys will probably be using a MacBook or MacPro and there shouldn't be any issues with the power to your USB ports.

Now to launch ADB - re-open terminal (remember that you had quit it - very important!) then type in:

adb devices

And you should see:

List of devices attached

HXXXXXXXXXX device

where XXXXXXXX is your unique phone ID.

Now you can run all of your favourite ADB commands straight by typing:

adb shell

etc straight into Terminal. I won't go into that here as there are plenty of guides about what to do with ADB once it's installed!

Now you have ADB setup on your Mac and can run it without the need for installing HTC Sync - un-installing it - loading some modified drivers over the top !!!!

It all just works !!!!!!

INSTALLING ADB ON LINUX

Coming soon ...