[Nexus One Q&A, Help & Troubleshooting] nephron:
Hello All!

After much frustration with setting up ADB i finally got it working. Everyone said its simple and takes minimal knowledge but when things dont work, nothing really worked. Anyways after 2 hours of research trying to get ADB to work i finally got it all working and wanted to share my knowledge to anyone else that needed help.

This Guide is for windows only. If you are using Mac OS X please go here: ADB For Dummies

If you are using Linux please go here: [HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux

Like My Guide(s)?

Donate

--------------------------------------------------------------------------

Things you need:

Android SDK - Download

Winrar - Download (32bit) Download (64bit)

Windows PC

USB Cable

A Rooted HTC Dream (Google G1)

--------------------------------------------------------------------------

Setting up the Android SDK

Download the file from above

Unzip to your desktop

Take the "android-sdk-windows" folder and move it to the root of your hard drive (C:\)

Right click on My Computer and click properties

Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)

Select Environment Variables...

Press New

For Variable Name type: adb

For Variable Value type: C:\android-sdk-windows\tools

Now, [Get new sdk (1.5r3) to work]

1. Run SDK Setup.exe

2. If it gives you an error go to settings and click on "Force http//....."

3. Select all options and let it download and install

If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)

--------------------------------------------------------------------------

Preparing your phone for ADB

Go to Settings on your phone

Select Applications

Select Development

Make sure 'USB Debugging' is checked

--------------------------------------------------------------------------

Installing Drivers

Plug in your phone through USB and DO NOT MOUNT IT!!!!!

Your computer should see a new device and try to install Android 1.0 driver (If it doesnt, scroll down to the "Im not getting a notification of Android ADB when i plug in my USB" section)

Let it load

Once it cant find them select "Install drivers from my pc"

The drivers you need are in the Android SDK 1.5r2 folder (C:\android-sdk-windows\usb_driver)

Depending on your OS pick x86 or amd64

You ADB Android Device should now be installed! Good Job :D

For Android SDK 1.5r3+

1. Run SDK Setup.exe

2. If it gives you an error go to settings and click on "Force http//....."

3. Select all options and let it download and install

If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)

--------------------------------------------------------------------------

Check if your phone is detected by ADB

Open up Command Prompt (Go to run, type in cmd, press enter)

Type in

cd C:\android-sdk-windows\tools === Press Enter
adb devices === You should see your device listed
adb shell === you should see # in the next line

Now you are all set to run adb commands

Note: for a list of commands type in 'adb' in cmd

CONGRATS YOU NOW HAVE ADB FULLY RUNNING!

--------------------------------------------------------------------------

Droid Explorer by Camalot

Droid Explorer is a Windows software that will download, install, and setup the android SDK for you all in under a minute so you are ready to go. I use this on a daily basis. This amazing piece of software has tons of plugins and a built in file explorer for all your files on your phone! All you gotta do is download, install, and go!

Download Droid Explorer - Here

Install the program, and let it setup the SDK files for you

Connect your phone

Enjoy!

--------------------------------------------------------------------------

"Im not getting a notification of Android ADB when i plug in my USB"

Why: Your computer has detected your phone but as a protable device and as a storage device.

Fix: This took me a lot of research and time to figure out so this is what your are going to do.

First download USBDeview - Here

Unzip it

Run USBDeview.exe as Administrator

You will see all drivers being used on your computer

Highlight and Uninstall all drivers with the description have HTC Android (Should be 3 of them)

Right Click on the driver and press uninstall

Once done, Unplug your phone and plug it back in

You should now get the notification of the ADB device

Follow the steps above to install the drivers

--------------------------------------------------------------------------

When Typing just adb in cmd you will get whats called a "usage doc" which gives you a lits of commands that you can use:

-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.

If -p is not specified, the ANDROID_PRODUCT_OUT

environment variable is used, which must
be an absolute path.
devices - list all connected devices

device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb jdwp - list PIDs of processes hosting a JDWP transport

adb install [-l] [-r] <file> - push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.

adb help - show this help message
adb version - show version num

scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb root - restarts adb with root permissions

networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:

- If <directory> is not specified, both /system and /data partitions will be u
pdated.

- If it is "system" or "data", only the corresponding partition
is updated.

--------------------------------------------------------------------------

Commands that you should know

adb push - Insert file to phone such as Stock.apk to /data/app_s

adb push <pathtofile.apk> <file system location> - Example: adb push c:\app.apk /data/app

adb pull - Remove file from phone such as Stock.apk from /data/app_s

adb pull <pathtofile.apk> - Example: adb pull /data/app_s/Stock.apk

adb install - Install app to phone

adb install <path to file> - Example: adb install c:/apps/apps2sd.apk

adb uninstall - Uninstall app from phone

adb uninstall <name of application> - Example: adb uninstall linda.apk

For more ADB Commands go - Here

--------------------------------------------------------------------------

Thats it for ADB! Congrats and if you have any questions please ask me or if anything is missing or not correct please tell me. I got all of this from research and personal experience. :D