How-To: adb for Windows, made easy?
This is a discussion on How-To: adb for Windows, made easy? within the Droid Hacks forums, part of the Droid Hacking category; OK, so we all want to jump in and mod/hack our Droid and rightfully so, being open source and all.
But wanting and able to ...
-
How-To: adb for Windows, made easy?
OK, so we all want to jump in and mod/hack our Droid and rightfully so, being open source and all.
But wanting and able to do can be a little frustrating for some, me included, until I figured it out
We see people answering our questions, "just do adb to do this and that". Which usually makes us react when we first see it "adb?, what the he!! is that, and where is it?", I don't get it in terminal or get errors", etc etc.
ADB = Android Debug Bridge, In a nutshell for our(typical users) purposes, It allows us to access our Droid using the Command Prompt on our PC. If you want to know more, google it, or visit Androids Developer site here:
Android Debug Bridge | Android Developers
Also for a little more in depth information, check out the thread here at the DroidForums written by alquimista:
How To Use ADB: All Commands and Options
I'm going to try and layout as simple as I can, how to set it up on a Windows PC. I'm sure there are other variations or preferences by others, but this is how I did it, and it works as designed.
I'll try and keep it simple as possible yet with just enough detail to hopefully eliminate some of the frustrations,,lol.
NOTE: If I miss anything or you have something to add(without getting to complex) please let me know and I'll make the appropriate edits to this post.
Preparation
We need to get a few things before getting started with adb, so for now it's just download time.
Download everything to your Desktop for now, so you don't have to hunt them down later during this process. When we're finished and if you decide to keep everything, then move the downloaded files to where ever you please.
Download the SDK from Android - This is where the "elusive" adb resides.
Android SDK | Android Developers
(The link takes you to the download site where you can get the SDK for Windows, Linux, and Mac.)
Windows users download android-sdk_r04-windows.zip (current version at time writing this guide- Make sure you get the latest version though)
Download the Motorola USB Drivers
Motorola drivers are needed for proper communication between adb and our Droid in Windows.
Your going to get one of these:
Motorola 4.6.0 Driver with MotoConnect* (for 32-bit versions of Windows®)
Motorola 4.6.0 Driver with MotoConnect* (for 64-bit versions of Windows®)
Depending on your version of Windows.
Download the drivers here:
USB and PC Charging Drivers - Motorola USA
(Don't worry about the PC Charging Drivers, they are not needed)
Installing and Setting Up
SDK Installation/Setup
Extract the android-sdk_r04-windows.zip to your local drive, this for most will be C:
Afterwards you should see a folder on your C: drive called android-sdk-windows.
The path should be:
C:\android-sdk-windows
To make things a little easier for later, we're going to rename it. So right click on it and select "rename", type in android, hit enter on your keybaord and make sure the name change takes effect.
Now the path should be:
C:\android
Guess what?! You just installed SDK and ADB! Simple enough, right
Motorola Driver Installation
Why do I need these when I can already see the Droids sdcard in Windows?
The sdcard can be seen due to the native drivers in Windows, which is just like plugging in a flash drive and nothing more. But for adb we need a specific driver for proper communication.
It's called Android Composite ADB Interface, without it, adb will not see your Droid.
What we downloaded from Motorola provides this.
The file downloaded is a zip file, double click it and drag out the file to the desktop. Double click on it to install the drivers.
Done.
At this point adb is ready for you to use!
Making it a little easier
As we stand at this point, adb can be used.
ADB is used through Windows Command Prompt, it's like the old days of DOS but in Linux flavor.
As it is now to get adb going, you would open the Command Prompt window and cd(change directory) to the directory(folder) where adb is and type the adb shell command.
To avoid all this typing, and get to the shell quicker, we're going to add it to our path in Windows, so all we have to type when in the Command Prompt window is adb shell.
To do this, we need to get to the System Properties in Windows.
It's basically the same in XP, Vista, and Windows 7.
There's two simple ways to get there:
1 way = click Start > Control Panel > System icon.
2nd way = click the Start button, right-click “My Computer”(Computer for Vista/7) and select “Properties”.
If your using XP, your there. If your using Vista/7, click on Advanced system settings on the left side.
You should now be in the System Properties window.
Click on the Advanced tab.
Click on the Evironment Variables... button
In the System variables(lower box), scroll through the list until you see Path under the Variable column.
Click on it to highlite it, click on the Edit... button.
We are going to add our path to adb, where we installed the SDK, in the Variable value: box.
Make sure your cursor is at the end of the last entry, and type this:
;C:\android\tools\
Be sure not to have any spaces!
(If your local drive isn't C: then just use the letter of your drive instead of C: )
Click OK on everything, and close Control Panel if it's open.
Now to use adb, at the prompt we only need to type in adb shell
That's it, you now have adb and it's ready to use!
Using adb with our phone
We need to set it up our phone so it will communicate with adb.
Don't worry, it's easy
On the phone hit the Menu button, go to Settings, go to Applications, go to Development, check the USB debugging check box.
Done.
Plug phone in to PC,
in XP - Click Start > Run > type CMD > click run.
in Vista/7 - Click Start > type in the Search program and files bar CMD > click on cmd.exe
You should now see a Command Prompt window (DOS box)
type adb shell
You are now using adb on your phone and start typing those commands!
If you get a message on the lines of ",,not an internal command,,," Then go over the steps above in the "Let's make it a tad easier to use though" section.
A couple little side notes:
First, When using adb, it's not a good idea to have your sdcard mounted on phone.
e.g. Check the USB debugging box, plug phone in, now at this point if you where going to transfer pictures or whatever, you would bring down the notification shade and press USB connected and then mount, Don't do this if your going to use adb.
If you plan on using su, your phone must be rooted.
Second, For the most part when we see the commands to mod/hack our Droids, they usually start out:
su
mount -o rw,remount,,,blah, blah, blah
I think it's because it's just assumed that your already in the adb shell
So, just remember, you need to start the shell first:
adb shell
su
mount -o rw,remount,,,blah, blah, blah
Push and Pull
When pushing and pulling files with adb, we DON'T use adb shell. We have to cd(change directory) to the sdk tools folder.
The tools are at C:\android\tools, so at the command prompt type:
cd \android\tools
Too push files, copy the files to the tools folder on the PC.
We'll use two files as an example, at the command prompt type:
adb push recovery-0.99.2b.img /sdcard < this copies recovery-0.99.2b.img to the sdcard in phone
adb push bootanimation.zip /data/local/ < this copies bootanimation.zip to /data/local/ on the phone
Pulling files is the same concept.
Example to pull an image file from sdcard:
adb pull /sdcard/image.jpg image.jpg < pulls image.jpg to c:\android\tools folder
Say you have a modified image, of the same one your going to pull, in the tools folder and you don't want to overwrite it.
adb pull /sdcard/image.jpg image.bak < pulls image to c:\android\tools folder and renames it
Oh, one more thing, when your finished using adb, and ready to use your Droid normally, type exit at both the # and $ to completely clear the pc from the phone and remember to un-check the USB debugging box on your phone.
I'm done
I hope this will help others out there and hopefully bring a little more understanding to the modding/hacking of our Droids.
~Peace
Last edited by mrZoSo; 06-17-2010 at 12:27 AM.
-
-
which pc charging driver am i suppose to download for windows 7 32 bit OS?
PC Driver 1 (W370, W375, W376g, W377) or
PC Driver 2 (W216, W230, W230x, W23x, W259, W270, W270x, W27x, W388, W396, W397, W397v)
-
You don't need the charging drivers, Windows native drivers take care of that. You only need to get the 32bit version of the Motorola Mobile Phone USB Drivers.
-
I'm on a Mac, so I'm not sure if you will be able to help me or not. I placed the SDK folder in my "Macintosh HD" and then in a folder named "Android". What will the path be that I type before "adb devices"?
-
thank you!!!! i think all i needed was the drivers..... i couldent get anything to work the way they are in the tutoirals......
-

Originally Posted by
JhankG
I'm on a Mac, so I'm not sure if you will be able to help me or not. I placed the SDK folder in my "Macintosh HD" and then in a folder named "Android". What will the path be that I type before "adb devices"?
I'm not real familiar with macs anymore. Check out this thread, maybe it will help.
How To Use ADB: All Commands and Options
-

Originally Posted by
rican408
thank you!!!! i think all i needed was the drivers..... i couldent get anything to work the way they are in the tutoirals......
Yeah, I seen alot of people have adb ready but getting no devices seen when they adb, and missing drivers is usually the cause.
I was in the same boat kind of, I basically had to check out multiple tutorials and sort of piece everything together to get adb to work. That's one of the reasons I wrote this.
I'm glad it helped you out.
-
So I think I got it now. It shows a $ sign...
So if I were to start to enter in adb shell it would go something like...
$su
mount -o rw,remount,,,blah, blah, blah
right?
-
like this:
adb shell
your prompt will look like $
su
prompt turns to # , you now have root
-
MrZoSo,
Nice write-up and not much to add. As a matter of fact this is more of a subscription so I can link to this post, as you have covered Alquimista's thread that I had been linking to for the adb queries. The only little nit to add would be that when I am done with whatever I am doing with SU in the command prompt, I like to type exit at both the # and $ to completely clear the pc from the phone. I am somewhat sure it is not necessary, but I am not 100% sure, and it would not be needed if your shell session reboots the phone.
I sure wish the moderators here would consider stickying some of these. We had a discussion in a thread with Rintin who concurred that the powers to be are not keen on stickying things like root, rom and other brickable offenses, but ADB and SDK are moto/vzw approved, are not changing daily. Surely an adb sticky would not be out of line.
Craig
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Similar Threads
-
By z4pp in forum Hacking Help
Replies: 926
Last Post: 09-27-2010, 09:32 AM
-
By soba1 in forum Droid Applications
Replies: 1
Last Post: 01-20-2010, 11:35 AM
-
By Phillip944 in forum Droid Applications
Replies: 6
Last Post: 01-12-2010, 01:33 PM
-
By Diablo2112 in forum Droid General Discussions
Replies: 0
Last Post: 11-11-2009, 10:07 PM
-
By rlb in forum Droid Audio / Video
Replies: 0
Last Post: 11-10-2009, 02:33 PM
Search tags for this page
adb droid
,
adb droid download
,
adb for windows
,
adb on windows
,
adb pull remote object does not exist
,
adb remote object does not exist
,
adb shell download
,
adb shell for windows
,
adb shell for windows 7
,
adb shell in windows 7
,
adb shell windows
,
adb shell windows 7
,
adb windows
,
droid adb download
,
easy adb
,
easy adb setup
,
how to install adb on windows 7
,
set up adb on windows 7
,
windows 7 adb shell
,
windows adb
Click on a term to search our site for related topics.