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.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
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.
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Sounds like you haven't successfully added adb to your DOS path. Re-read section 2 again and make sure you followed the instructions correctly.
Great guide man, very nice work
That's awesome!!! It's a nice tutorial for the newbies! And it benefits me, I reli like it!!
Thx!!!
Sent from my E15i using XDA App
jubo1236 said:
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Click to expand...
Click to collapse
I had the same problem because the path was incorrect. I found the adb command in
Code:
android-sdk-windows/platform-tools/
rather than in
Code:
android-sdk-windows/tools/
btdag said:
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.
Click to expand...
Click to collapse
hi,
thanks for the explanation both for you and ante0 but can you reload the link if possible becaue i cannot download the file for the first step? it gives error
No matter what I do. I always get the "adb" is not recognised as an internal or external command , operable program or batch file. What am I doing wrong?
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
After doing all the above stated i still can't execute any commands. I typed "adb devices" and it just says the devices that are linked but it doesn't give me a serial number.
NeatBee said:
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
Click to expand...
Click to collapse
What does it say? Copy it to here
Sent from my Hero using Tapatalk
I have tried to restart the computer, sign in and out, install SDK again and again, changed the PATH in Enviromentor variables ... but still refuses ADB to work!
I typed "C: \ android-sdk-windows \-platform tools," in the PATH box and restarted the computer. Then I typed "adb" in CMD, but it is all the time: "'adb' Is Not Recognized as an internal or external command,
operable program or batch file. "
Is crazy! What is the problem?
BTW, I have installed the driver for my phone and selected "USB debugging".
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
hello
NeatBee said:
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
Click to expand...
Click to collapse
I think you are using wrong format, \ instead of /
For me I used "C:\Program Files\Android\android-sdk-windows\platform-tools\;C:\android-sdk-windows\tools\;"
in order to make it work"....ignore quotes.
Yet when I try to do the push command with some files
it gives me error: devise not found
anyone have clue?!
Thanks
This guide is rock solid! Thanks
mm realy need to learn to use adb been flashing my hero for over a year now and still dont know how adb works
sorry for the silly question but will the same steps help to setup a path for windows 7
because i really need to know how to use it as well if someone acn post a link for steps to use it it would be really appreaciated
thanks
EDIT: extremely sorry did not read the full post there is already a guide for windows 7
thanks for the post
ok so i have tried all of the above steps
i now get adbd cannot run in production builds
thanks alot
once i get adb all set up and it works fine - can i uninstall HTC sync and HTC driver? will adb still work?
I have learned alot from this site so i figured i'd give something back. these are the the two easiest methods i have found for setting up the android debug bridge. one for windows and one for linux... these instructions should work for any version of windows.
first make sure you download the latest sdk by going to android.com and clicking on developers.
windows:
after you have download the sdk, unzip it to your desktop. rename it to sdk. cut the UNzipped folder on the desktop that you just renamed by right clicking and hitting "cut" then go to start>my computer>c: and paste the folder here. now go into the new "sdk" folder and right click on the "tools" folder and click "send to" then choose "desktop (as shortcut)" you should now have a shortcut on the desktop called "tools-shortcut"
now for the easy part: hold shift and right click on tools-shorcut, holding shift adds the option "open command window here" to the context menu that comes up so click on that. now just make sure your phone is connected to the computer and on ur phone debugging is enabled (menu>applications>development>debugging). on ur command window that came up you should see a black box with white text and the cmd should be c:\sdk\tools> just type "adb devices" and you should see your phone under "list of devices attached" if you do see it you should be able to start running adb commands
adb pull "/location to file or folder on phone" -(the pulled folder or file will be in the tools folder we created earlier which you can still access by clicking on the tools-shortcut on your desktop)
adb push "name of file or folder to be placed on the phone sdcard" -(make sure the file or folder you wish to place on the phone has been placed in the "tools" folder on the computer, again its the same folder the "tools-shortcut" opens up)
hint and examples: i have found a good way to back up and reinstall all ur apps using just adb push and pull. just experimenting and playing around with it i have found you can accomplish installing with just knowing these commands above... if you plan to data wipe and flash a new rom but you don't want to go through the tedious task of reinstalling and you have a rooted android phone then you may use this method to backup/reinstall ALL of your apps. plus this will give you good practice using adb.
backup example:
adb pull /data/app .... let it finish
adb pull /data/app-private ...let it finish
now you should have ALL of ur apps in ur tools folder on ur computer! in the tools folder, create a new folder and name it what u want, i named mine APPS4EVO because i have an evo and and epic and some apps don't work for both so i keep them seperate. cut and paste all of ur apps and put them into your newly made folder. now back to the adb window
restore example:
adb push /APPS4EVO /data/app/
this will push all of your apps in your backed up folder you made earlier to the folder where apps go when they are installed and if you wait 1-10 minutes depending on how many apps you have you should be able to see them on ur phone as if you had installed them one by one. also notice the space between /APPS4EVO and /data/app/ the space seperates the folder from inside ur tools folder you wish to install and the location you wish to put them on ur phone. please be aware that you do not need to type c:\sdk\tools\APPS4EVO because the command window is already being ran in the tools folder, so the location would just be /APPS4EVO in my case.
adb shell -opens up the terminal shell to run commands specifically for the phone, while in the shell you cannot run other "adb xxxxx" commands, you will have to exit the shell by typing "exit"
OPTIONAL: i marked this as optional bc with the above it is not necessary... i have never done this and my adb works great but i have seen it often in other tutorials around the web.... i believe its only necessary on windows 7 and maybe vista. go to start then right click on "my computer" and click on "properties" then in the left pane click on "advanced system settings" then in the window that pops up click on "environment varables" button, in the next window that pops up, under "system variables" scroll down to the "path" variable and double click it. in the "variable value" box do NOT erase anything but add ";c:\sdk\tools" (without quotations). then click ok on all the windows cuz ur done.
thats all for windows.
linux (ubuntu)
extract the sdk to your home/name/ folder and rename it to sdk. now right click on the folder and go to permissions and make sure (run as executable) is checked, now go into the folder and do the same permission change to the tools directory.
now you should be able to run adb commands in the terminal when your phone is connected. same as in windows except your commands will be preceded by your tools folder location....
FOR EXAMPLE:
/home/jay/sdk/tools/adb devices
/home/jay/sdk/tools/adb push xxxx xxx
/home/jay/sdk/tools/adb pull xxxx
EXTRA:
if your having troubles connecting ur phone to ur computer over usb, even after installing drivers, like i sometimes have with my epic, you can download "wireless adb" from the market which i found to be surprisingly easy to use, just like if u were connected by usb, except under adb devices you will show up as your gateway address not ur device name but trust it still works the same.
good luck everyone, i hope this post isn't redundant and i really hope i help someone out there just starting! adb is confusing at first.
I installed Honeycomb onto my sd card following instructions to the tee. I also unzipped the android sdk files onto the sd card as well. Now when it comes to opening a command prompt in that folder I am completely stupid. I go to My computer and the sd card shows up under the F: drive. How do I open a command prompt for my F drive (ie.. what do I type?)? I know it's a stupid question, but I really don't know how to do it.
Not sure why you need a command prompt on that file, but in your computer, you can go to start -> run -> then type "command" (without the quotes) to get a command prompt
Which instructions? If you're using windoze, you shoulda downloaded some files to a windoze folder, not the sd card if I remember correctly. To open a command prompt in the open windoze folder use shift-right click and select "open command window here".
Smiley
Thank you for the shift-right click. Still learning something new every day.
Had some interest in this, so I thought I'd make a quick thread about it. Not a big secret or anything, just a little time saver.
Here is how to set up your computer so that you can run a fastboot, adb, etc. command from anywhere in the file system. You will no longer have to goto the fastboot folder and the type the full file path to the file you are trying to install, push, etc. if you saved it somewhere else, or clutter up the same folder you have these important files saved in.
*These instructions are for Windows 7 (x64):
First make sure that your fastboot files, adb files, moto-fastboot files are in a folder that isn't going anywhere (give them a permanent home on your pc ).
Then do the following:
Navigate to: Control Panel -> System ->Advanced System Settings -> Advanced Tab -> Environmental Variables
Under "System variables" scroll down to the variable labeled "Path" and choose Edit.
Go to the end of the Variable Value and add a ";" (no quotes) if needed on the end of the last variable, and then add the complete file path to the location of your files (only add spaces if there are spaces in the file path). So mine would be: ....;C:\android-sdk-windows\tools
OK out of everything.
Now you can just shift + right-click in the folder you saved the file, Open command window and type the command.
*Note: If you change the location of your fastboot files, you will have to change the location in the variable path again, otherwise this wont work. Capiche?
Swiftks said:
Had some interest in this, so I thought I'd make a quick thread about it. Not a big secret or anything, just a little time saver.
Here is how to set up your computer so that you can run a fastboot, adb, etc. command from anywhere in the file system. You will no longer have to goto the fastboot folder and the type the full file path to the file you are trying to install, push, etc. if you saved it somewhere else, or clutter up the same folder you have these important files saved in.
*These instructions are for Windows 7 (x64):
First make sure that your fastboot files, adb files, moto-fastboot files are in a folder that isn't going anywhere (give them a permanent home on your pc ).
Then do the following:
Navigate to: Control Panel -> System ->Advanced System Settings -> Advanced Tab -> Environmental Variables
Under "System variables" scroll down to the variable labeled "Path" and choose Edit.
Go to the end of the Variable Value and add a ";" (no quotes) if needed on the end of the last variable, and then add the complete file path to the location of your files (only add spaces if there are spaces in the file path). So mine would be: ....;C:\android-sdk-windows\tools
OK out of everything.
Now you can just shift + right-click in the folder you saved the file, Open command window and type the command.
*Note: If you change the location of your fastboot files, you will have to change the location in the variable path again, otherwise this wont work. Capiche?
Click to expand...
Click to collapse
Thanks you as I had trouble with this for my nabi2
Swiftks said:
Now you can just shift + right-click in the folder you saved the file, Open command window and type the command.
Click to expand...
Click to collapse
It turns out you CAN learn something new every day! This is a huge timesaver. I wish I had known this years ago!
Huge thank you! I knew i could do this somehow, but havet managed to do so before. Whit this guide i managed to get it working in windows 10 enviroment.
This post is to help you set your phones default install path to your phones sd card on any android device.
so here we go..............>>
1. First you have to enable USB debugging on your Android device from Settings > Applications > Development > USB debugging.
Now you need to download and install the Android SDK on your computer from google....please google it.
Once setup is downloaded and installed you click on Available Packages to the left.
should you get any error message at this point, enable “Force (url) in the Settings then from the list of available packages, select “Usb Driver package”, click on the Install Selected button in the bottom right corner and follow the prompts.
2. Connect your phone to your computer with a USB-cable. Your OS will prompt you to install new drivers.
Choose to install them from
C:\Program Files\Android\android-sdk\extras\google\usb_driver folder
when you are asked to install drivers
(If for some reason you are not asked to install drivers as it happens sometimes in windows 7. Go to device manager and look for your phone under the usb device list..............right click and choose update drivers....navigate to C:\Program Files\Android\android-sdk\extras\google\usb_driver folder" to update) If you do not know how to update then google it.
NOTE: You need not mount your device; you only need to plug-in the cable.
3. Next, run a command prompt and navigate to the Android-SDK/platform-tools folder. In Windows, this is done by selecting Run from the Start Menu (or by pressing Win+R) and typing cmd. You change drives in the command prompt by entering the drive letter followed by a colon ), and change folders with the CD command. For example, to enter the Android-SDK folder, simply type C: cd android-sdk.
4. Whiles in the Android-SDK/platform-tools folder, type in
adb devices
you should get a serial number starting with “H” in return. All you have to do next is enter
adb shell pm setInstallLocation 2
You’re done! Android will now install apps to the SD card by default.
To switch back to storing software on the internal memory,
enter
adb shell pm setInstallLocation 0
With everything done correctly you should not have that "annoying memory getting full" message anymore.
If you have a terminal application installed on your phone you can use also that for entering the commands and you should notice, too, that it works only with 2.x roms.
Sent from my Gingerbread on Dream using XDA App
Or you could use a utility:
http://forum.xda-developers.com/showthread.php?t=1765929
But how do you specify a specific directory?
Getting Error
I am getting error "/data/anr/traces.txt: Permission denied" when I give Command "adb shell pm setInstallLocation 2"
Please Help.....
On some updated SDK version its "set-install-location"
Hi,
I've done this and it worked. however I changed my sd card from 2Gb to 4Gb and now it will not work anymore.
I've redone the steps above and, got confirmation that [external] memory is being used, however when I want to install a new app I get the same error message "not enough space"
Android GT-S5830i
ver 2.3.6
Any suggestions
Thanks