Android Debug Bridge (adb) is a tool that lets you manage the state of an emulator instance or Android phone. ADB is bundled with Android SDK package that can be downloaded from Android SDK download page. This tool is usefull for communicating with Android phone such as install application, copy files from/to device and perform some linux shell commands.
How to Install
Phone Setup
In order to use ADB, you have to enable USB Debugging option in phone settings (Settings->Applications->Development)

How to Use
Update!!
New Android SDK puts adb executable file on \platform-tools directory instead of tool. So the path should be D:\android-sdk-windows\platform-tools
Usefull Commands
1. Check connected phone
Syntax: adb devices

2. Login to Android shell
Syntax: adb shell
![]()
Note:
If you get ‘#’ after typing adb shell, you are already get root access on the phone, no need to type su. Otherwise if you get ‘$’ , type ’su’ to get root access (only for rooted device).
3. Some usefull shell commands
List directory
Syntax: ls [path]
Example:
#ls /system/lib
Copy file or directory
Syntax: cp [options] source dest
Note:
To copy or delete files in Android root directories you have to change the directory access mode to ‘read and write (rw)’ using command: remount rw
Example:
#remount rw
#cp /sdcard/libsec-ril.so /system/lib
#remount ro
Move file or directory
Syntax: mv [options] source dest
Example:
#mv /system/lib/libsec-ril.so /sdcard/backup
Change file/directory permission
Syntax: chmod [-R] mode[,mode] …. file
Example:
#chmod 0644 /system/lib/libsec-ril.so
Remove file or directory
Syntax: rm [options] file
Example:
#rm /system/lib/libsec-ril.so
4. Install application
You can use adb to install aplication from your local drive into phone.
Syntax: adb install appname.apk
Example:
D:\android-sdk-windows\tools\adb install D:\AnReboot.apk

5. Copy files from phone to local drive
Syntax: adb pull source [destination]
Example:
D:\android-sdk-windows\tools\adb pull /sdcard/arm11-dvm.zip
D:\android-sdk-windows\tools\adb pull /sdcard/arm11-dvm.zip D:\

5. Copy files from local drive to phone
Syntax: adb push source destination
Example:
D:\android-sdk-windows\tools\adb push D:\AnReboot.apk /sdcard

Thanks Lorenz!:)
You’re welcome Jun
Hi,
i had everything installed , but im new in this . I try to fix problem with my HTC Desire of low space. But i cant write a command , the sign – still there . Someone tell me how to do that?
I want to installes apps in the SD card because the low space message. Thanks
Any error messages ?
sir how can i go to D:\android-sdk-windows\tool in cmd?
type:
D:
cd D:\android-sdk-windows\tools
Hi Lorenz,
I did everything but at time of running the adb command its giving error. “adb command is not recognized as internal or external command, operable command or batch file..
Can you help me out why this is happening? I am using Windows 7 ultimate operating system.
Thanks
You must be on the same directory where adb command exists (android-sdk-windows/platform-tools).
Sir, please help me. Adb commands in android.
D:\android-sdk-windows\tools>adb devices
Error has shown is not recognized as an internal or external commands operable program or batch file.
waiting for your reply.
really great help, I already have changed my theme now using adb:D
thanks to you!!
Hi Lorenz,
I see you say:
“If you get ‘#’ after typing adb shell, you are already get root access on the phone”
Can you say how to achieve this? More specifically how to run a sinhle command as root like so:
adb shell “command”
It’s driving me mad trying to script (on the linux pc) some adb commands to run as root on the phone.
You have to root the phone first. Root access depends on your phone model and custom rom.
I am trying to make a shortcut for the desktop with some commands in it.
I saved it as CMD.
It works until the command comes after adb shell.
These are the commands:
cd C:\android-sdk-windows\tools
adb shell
pm setInstallLocation 2
What am i doing wrong?
It stops after adb shell because cmd script pauses and waits adb to exit. You have just started adb and it takes the input. That’s why nothing happens after starting adb shell.Try to send some commands to adb in this way “command” > adb shell or adb shell < "command" where "command" represents yours commands to adb (with quotes if you are using space in command")
Hope to help you, and excuse me for bad english – it is not my native language
Hi
I’m new with this…I made:
* Download and install Java SDK (Ex: jdk-6u20-windows-i586.exe)
* Download Android SDK package (Ex: android-sdk_r06-windows.zip)
* Extract SDK package into anywhere on your drive (Ex: D:\android-sdk-windows)
But when i’m in the command window and I execute any adb command I receive this message:
adb is not recognized as an internal or external command, operable program or batch file
What is missing? It seems that windows dos not recognize adb but I made the above installation steps.
Thank you.
Hi, you have to go to sdk tools directory, D:\android-sdk-windows\tools then type adb or just double click on adb file.
Hi,
I didn’t find any adb file in the tools folder.
giving error msg “adb command is not recognized as internal or external command, operable command or batch file..”
am i downloading a wrong sdk file?
thanks
Google has moved adb executable file from ‘tools’ to ‘platform-tools’ folder. Type ‘cd your-andorid-sdk\platform-tools’
nconceic,
In the latest version of the SDK (with 2.3), you’ll have to go to the following directory to run ADB:
D:android-sdk-windowsplatform-tools
Hey lorenz!
I have been working with ADB lately, my question is regarding adb pull.
I can copy some file or directory with it by definition, but while you actually work, you will see, it transfer only certain types of file, if I want to retrieve some application data (which has already been installed on the device), this doesnt work. as it drops hidden or system related files. So is there anyway to pull out all the file regardless of they types.
One more thing, I would like to know your views on,
Is the any way to clone the entire phone memory on computer. I mean the exact replica of the phone memory.
Hey man, nice article but I have problem with connecting the phone. It`s connected and I`ve set on USB Debugging mode but it still displays “error: device not found”. What should I do?
Have you installed the driver ?
same problem with me. when i do adb devices it doesnt show any devices connected. I have installed the drivers
That’s must be a problem with device drivers, try to reinstall the drivers.
smae problem with me i m connected my device but it not display in list of adb devices.
and return error: device not found when run any command adb root or adb shell or any other.
i chk all thing like Usb debugging option is checkd,usb drivers properly installed, device also properly connected.
please help me wahts wrong here.
thanks in advance.
Hi lorenz,
Please help me.. http://www.londatiga.net/it/how-to-use-android-adb-command-line-tool/
same procedure i will follows.
First install c:\java sdk.
second android-sdk-windows.zip extract D: drive >android -sdk-windows , Mobile USB deubugging activate > then command window open (D:\android-sdk-windows\tools>adb devices) error is not recongized internal or external commands…
Waiting for your reply.
Use D:\android-sdk-windows\platform-tools
Thank you SO MUCH!!
I have a rooted Nexus One and have been trying for a long time to learn ADB commands to work with it, but there’s very little mercy for those who don’t already know this stuff on the popular forums (xda-developers, etc). NOW I can actually start making the changes to my phone that others have been talking about!
Hi I want to know what is the command if you want to change to install from internal memory to external memory. I’m using android 2.2
Thank you, this was extremely helpful, and just what I was looking for!
Hey man this was helpful, but my question is I was trying to change the locking sound on my phone (rooted epic 4g running ViperRom [Apocalypse])and the audio file is in the folder /system/media/audio/ui and i noticed that all the permissions were “-r-” but when I put the audio file I want there the permissions are “-rw” which is read and write. Do you know how I can change this to “-r-” I’m sure then it would play.
have u tried #chmod 0400 /system/media/audio/ui ?
no not yet…do i use this step after following some of the previous ones that you have shown above? thx for the reply.
I have an interesting problem. I am trying to install a program from the sd card via adb. If I look at the files when the phone is not connected to the computer, they are all on the card. When I connect to the computer and run adb it cannot find the files. If I look on the phone with its file manager it also cannot see the files when the phone is connected to the computer. Any ideas about why this is happening?
update: I figured it out. You have to go to menu – notifications- usb connection and change the connection from sd card to “portal & tools”.
ADB will then be able to see the files on the sd card when the phone is connected to your computer… Simple, but it will drive you nuts if you do not know this.
Good and thanx for sharing the solution here…;)
Hi Lorenz, your a hero!
I rooted my phone with faulty app, then it got slow and unstable, so i did the master reset. now a virus like warning sticks on the screen after start up and pin code in, saying the battery cover is open and asks for restart.
so it doesnt let me to do anything on the phone.
I need to install the ROM via adb, got an idea if it works? Im actually mushroom, so I need to know a format of Rom.update from their site is good or it should be .apk or should I wipe out all data in phone and push all files in? how should I do it.
hi, i followed the steps but when it comes to entering ‘D:\sdk-abdroid-windows\tool’ i get the message ‘The device is not ready’ any help would be greatful
thanks
This was a great help for newbie wanna be Dev!
performed my first /system/lib change using your guidance…. Thank you!
hi sir i am new to android .. please can u tell me how to do android CTS(compatability Test Suite) in windows7?
Thanks in advance..
Regards,
Mahes.
Is there anyway to access usb debugging and turn it on through the pc in some way. I am unable to enable it through my phone.
[...] so its going to be a little tricky. Stay with me and it will work!! first use following basic adb usage tutorial I found. you will need to transfer files and get logs from phone : http://www.londatiga.net/it/how-to-use-android-adb-command-line-tool/ [...]
Hi,
I’m Using Samsung Galaxy. Getting an error when I’m trying for root access “adbd cannot run as root in production builds”. Can any one help me to get the root access?
Hi Lorenz,
i want know how to copy and paste without using mouse in command promt and inside adb shell, is there any command for it to copy and paste like “ctrl c and ctrl v”
Inside adb shell, you can use standard linux command line to copy and paste.
i want to send SCSI command to SD Card
( or any external storage)….how can i do it in android (honeycomb 3.0)…
hi.Thnks for the help.But can you please tell me.That is it possible to add functionality in my application through which i can transfer files between pc and mobile,on usb cable.I am searching it from a long time and still stuck.
[...] I roughly followed these steps which are mostly right (see step 4 below): http://www.londatiga.net/it/how-to-use-android-adb-command-line-tool/ [...]
even i have da same error ]
adb command is not recognized as internal or external command, operable command or batch file..
whts da solution for it
Did u use the right path to adb executable file? (android-sdk-/platform-tools/adb)
when i use
adb devices
it get a question mark
ex: list of devices attached
? devices
—————————-
why is it soooooo
Hi all,
I have problem in creating the Android project and Android test Project via command prompt in windows 7. The same command is working nice in windows xp.
android create project –name HelloAndroid –activity HelloAndroid –path ./testing/ –package com.example.helloandroid –target 8
android create test
-project –name TestingProject –path ./Testing1/ –main C:/Andriod~Projects/AndroidCalculatorTest
The Android command itself is not identified. I have tried in the same directory and also i have set the environment variable tried nothing worked for me.
Can anyone help to solve the issue.
Is the Android is not supported by windows 7
Having a strange problem trying to use adb to push or install a program to emulator.
I cd to the tools folder OK and after typing adb devices the device shows up OK.
If I try to push or install from there it just hangs forever.
If I type adb shell I get the # so I know I have access but after that any further commands gives error ‘adb not found’ which of course it would not be found as I am no longer in the tools directory.
I think it is correct to invoke adb from tools directory and not from the # prompt.
But this poses another question. How to exit the root directory and return to tools directory or some other directory for that matter. Seems the only way to get out is to close the command tool and restart.
All OK. I figured it out. Just type EXIT
hello, the adb devices doesn’t list nothing…
but the tablet is connected..
make sure Settings->Applications->Development-> USB debugging is checked.
Hi all ,
I wanted to write a script in Windows for invoking a test case for issuing a reboot over # adb shell .
Would be greatful for any help
Thanks
-Rajesh
I want to change read only state of the systems folder my current boot animation is in to “read write”so I can insert my new boot animation zip in there. I am new to this method and only rooted my samsung fascinate once and flashed a new ROM only twice. I rooted via SuperOneClick and currently running PowerWashed GB beta3…I downloaded a file manager and downloaded a terminal emulator to phone so far via the market. If I understand this so far correctly,I connect the phone to pc, open terminal emulator on phone and a cmd screen pops up on pc? Then what do I Type to get this done? Everything on the web that speaks of this is in a way that a newbie like myself still doesn’t understand…sorry for the ignorant question.
how do i read data from tables???please help me with it..
please help me with how do i read data from table..
What did u mean? could u explain more detail?
please help me with how do i read data from tables…
hi,
i have samsung galaxy ace GT-S5830
in the cmd command box after i type adb shell it gives a “$” sign after which typing “su” gives me access is denied..
just updated the latest firmware
is that any problem?
coz in the usb debugging mode am not able to enter the sd card..
it says please insert disc in removable drive
Hi Minam,
That was because your device was not rooted. You can get root access by typing su if you haven’t rooted the phone.
Hi Lorenz,
Good Morning, Need your help.
I have some doubts in Android ADB commands using incoming call through commands like AT commands..
Please tell me
Regards
Balaji
Hi Balaji,
It is imposibble to run AT command via ADB interface
Hi Lorenz,
Good Morning, Need your help.
I have some doubts in Android ADB commands using incoming call through commands like AT commands..
Please tell me
Regards
Balaji
Hi lorenz,
Thanks for your reply. But AT commands used in Android mobile. If it is possible..
Regards
Balaji
Hi,
The root cause of the problem is Command Prompt is not finding location of android tools executable.
Please update PATH environment variable of operating system to proper location of android tools. Please mail me for further assistance.
hi altaf,
urgently need your help to run the adb command. i keep get error “adb command is not recognized as internal or external command, operable command or batch file..”
please guide me step by step.
thanks in advance..
Hi Lorenz
I need your help please. I have a HD2 running Nandroid with ext3 on SD card. Lately I tried to fix the phone and accidentally broke the Rigid Flex cable that connected to the volume rocker hence I can not use the volume rocker any longer and of course no more flashing or recovery ect…
I bought a new phone and took the SD card from the HD2 to use with the new one. I format the SDcard to use with the new phone. Things went great …
I now decided to sell my old HD2 for parts and needs to erase personal info before selling it.
Android wouldn’t go pass the animation since all the system app was store in the extension and I already reformat the card.
I know there must be a way to erase my Nandroid from ADB but I don’t know the command. Can you help me with that please
Greatly appreciates
Thank you
Hi Tommy,
Since the volume button is broken i think it is impossible to enter recovery mode. You have to fix the volume button first.
[...] funktioniert auch nur wenn USB-Debugging eingeschaltet ist. Eine Anleitung dazu gibt es z.B. hier: http://www.londatiga.net/it/how-to-u…and-line-tool/ Wahrscheinlich wird aber auch das nicht klappen, denn der Root Explorer geht wahrscheinlich auch [...]
The Android shell does not have the cp command. http://stackoverflow.com/questions/4714411/how-to-copy-and-edit-files-in-android-shell
Instead you can use:
cat source_file > dest_file
Hi,
I am trying to run a NDK executable on my Samsung Galaxy S2 phone without rooting it.
To push the files to /data/local/tmp I did:
adb push D:\NDK\tmp /data/local/tmp
With this I was successfully able to push the files. Hence I think /data is the writable folder on my phone. Once I copied the file, I went to the data/local/tmp folder by doing cd and then I can see the file using ls. Now to run the executable I typed ./tmp but I get an error: “permission denied”.
Please let me know if you have any ideas about this error and how can I resolve it.
Thanks
Hi, permission denied means you don’t have privilege to execute the file, you have to get root access to do that
I am using a a samsung galaxy tab, and ever since I rooted it to remove some bloatware, the camera and the flashlight could only be used by system apps. I have no idea as to the cause, but I am very capeble of doing anything it would take. If you can help me with this, it would be very much apreciated. Also, will a command line emulator do the same thing as the SDK?
Hello,
I need help, (when you said If you get ‘#’ after typing adb shell, you are already get root access on the phone, no need to type su. Otherwise if you get ‘$’ , type ’su’ to get root access (only for rooted device). but me when i tape ’su’ i have a message “su not found” at all, howto get su binary ? I am using a samsung galaxy tab. thanks
You have to root your phone first, try to search guide on how to root galaxy tab on google or xda forum.
GUYS!! Try this one. download APKInstaller 1.01 and install it. Now switch on USB debugging on your phone and in Windows Explorer click the apk file you want to install and it gets installed… Easy!!
hi,
i am using adb pill command for getting .nmea file.
>adb pull /data/misc/location/gps/nmea C:\Android
but it gives an error like
remote object ‘/data/misc/location/gps/nmea’ does not exist
Could you please help me?
That means the file doesn’t exist, make sure the file name is correct