The Android Debug Bridge (adb) is a tool lets you manage the state of an emulator instance or Android-powered device.
I was trying to run it for the first time on my ubuntu 9.10 box and I kept getting this error:
No command 'adb' found, did you mean:
Command 'cdb' from package 'tinycdb' (main)
Command 'gdb' from package 'gdb' (main)
Command 'aub' from package 'aub' (universe)
Command 'dab' from package 'bsdgames' (universe)
Command 'mdb' from package 'mono-debugger' (universe)
Command 'arb' from package 'arb' (multiverse)
Command 'tdb' from package 'tads2-dev' (multiverse)
Command 'pdb' from package 'python' (main)
Command 'jdb' from package 'openjdk-6-jdk' (main)
Command 'jdb' from package 'sun-java6-jdk' (multiverse)
Command 'ab' from package 'apache2-utils' (main)
adb: command not found
What was I doing wrong?
A quick google search shows me the error of my ways.. I haven't added my Android SDK tools directory to my system path!
It should go something like this...
open a terminal window and type:
$ echo $PATH
---(should return the directories associated with $PATH)
$ export PATH=$PATH:/home/YOUR-USERNAME/sdk/tools
---(replace with path to your tools directory, you may need to add 'sudo' to the beginning of this cmd)
Update: later versions of the SDK have ADB moved to the platform-tools directory, so adjust the above accordingly.
$ echo $PATH
---(you should now see your tools directory added to the end of the $PATH variable)
$ adb devices
---(now adb should do something, if nothing else at least error, no devices)
And now I get:
List of devices attached
p.s. Adding to the system path in Windows is along the lines of :
- right-click '(My) Computer'
- Select 'Properties'
- Go to 'Advanced' or whatever tab you find 'Environment Variables'
- Select 'Path' then 'Edit' and add your new path in.
Update: if you are using 64-bit linux you may need to also install the ia32-libs package like so:
sudo apt-get install ia32-libs