728x90

adb command not found in linux environment

Work at Stack Exchange

  • London, United Kingdom
  • 20+ days vacation
  • Insanely great workstations, chairs, and desks
  • Yearly stipend for conferences

While implementing the BluetoothChat application .apk inside G1 device, it always pops up a message:

$adb install -r /home/parveen/workspace/BluetoothChat/bin/BluetoothChat.apk 
-bash: adb: command not found

I am not getting clearly why this error is popping up every time. Please help me.

Thanks in advance. Praween

share|improve this question
2  
Belongs on Superuser.com – t0mm13b Mar 25 '10 at 16:49
add comment (requires an account with 50 reputation)

11 Answers

I found the solution to my problem. In my ~/.bashrc:

export PATH=$PATH{}:/path/to/android-sdk/tools

However adb is not located in the tools/, rather in platform-tools/. So I added the following

export PATH=$PATH{}:/path/to/android-sdk/tools:/path/to/android/platform-tools

And that solved the problem for me.

share|improve this answer
add comment (requires an account with 50 reputation)

Work at Stack Exchange

  • London, United Kingdom
  • 20+ days vacation
  • Insanely great workstations, chairs, and desks
  • Yearly stipend for conferences

Updating the path as listed above in ~/.bashrc makes other bash commands stop working all together. the easiest way I found is to use what eaykin did but link it your /bin.

[sudo] ln -s /android/platform-tools/adb /bin/adb

No restart required jsut type

adb devices

To make sure it's working.

share|improve this answer
Cheers. Works here. – Phix Jan 9 at 18:40
ln: creating symbolic link `/bin/adb': Permission denied This error is arising... Any idea ???/ – KK_07k11A0585 Feb 15 at 9:01
Thanks so much - this helped a lot! – Enke Feb 25 at 7:41
This worked for me very easy thank you @masterdam79 – Hans Jul 10 at 13:26
add comment (requires an account with 50 reputation)

I had the same issue on my fresh Ubuntu 64 bit installation, and the path was set up correctly.

Thus, which adb would resolve correctly, but trying to run it would fail with adb: command not found.

The very helpful guys at #android-dev pointed me to the solution, namely that the 32 bit libraries hadn't been installed. On my previous computers, this had probably been pulled in as a dependency for another package.

On Ubuntu (probably other Debians as well), running [sudo] apt-get install ia32-libs

share|improve this answer
add comment (requires an account with 50 reputation)

You need to add $ANDROID_SDK/tools to your PATH, where $ANDROID_SDK is wherever you installed the Android SDK.

share|improve this answer
add comment (requires an account with 50 reputation)

adb is in android-sdks/tools directory. You simply type this command: adb logcat.

If you want to your stack traces in a text file use this command: adb logcat > trace.txt. Now your traces are copied into that file.

If it is not working then go to android-sdks/platform-tools then put this command: ./adb logcat > trace.txt. Hope it will helps to you.

share|improve this answer
add comment (requires an account with 50 reputation)

I have just resolved the problem myself on mint(ubuntu). It seems that adb is a 32 bit executable at least according to readelf -h. for the program to work in 64-bit ubuntu or whatever installation, we must have 32-bit libraries inplace.

solved the problem with

sudo apt-get install ia32-libs

I hope this is helpful. One more thing that may be of importance is oracle java 6 installed , but i am not sure this is necessary to resolve the problem.

share|improve this answer
add comment (requires an account with 50 reputation)

The way I fix this problem is:

  1. create a link from adb file(drag 'adb' with holding alt then drop to any directory and select 'link here')
  2. use #sudo cp adb /bin (copy link from 1 to /bin)

I've done this several times and it works 100%(tested on Ubuntu 12.04 32/64bit).

share|improve this answer
add comment (requires an account with 50 reputation)

NOTE: while using adb on Linux you'll need to type ./adb to execute adb commands unless you create a path in ~/.bashrc. In a terminal write:

sudo gedit ~/.bashrc

Add the following line at the end of the file. Once you're done, save and exit.

Android tools

export PATH=~/Development/adt-bundle-linux/sdk/platform-tools:~/Development/adt-bundle-linux/sdk/tools:$PATH

Then in a Terminal run this command to reload your .bashrc: Code:

source ~/.bashrc

Now you can just run adb without put ./ before every command.

share|improve this answer
add comment (requires an account with 50 reputation)

updating the $PATH did not work for me, therefore I added a symbolic link to adb to make it work, as follows:

ln -s <android-sdk-folder>/platform-tools/adb <android-sdk-folder>/tools/adb
share|improve this answer
add comment (requires an account with 50 reputation)

I had this problem when I was trying to connect my phone and trying to use adb. I did the following

  1. export PATH=$PATH{}:/path/to/android-sdk/tools:/path/to/android/platform-tools

  2. apt-get install ia32-libs

  3. Connected my phone in USB debug mode and In the terminal type lsusb to get a list of all usb devices. Noted the 9 character (xxxx:xxxx) ID to the left of my phone.

  4. sudo gedit /etc/udev/rules.d/99-android.rules

  5. Add [ SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev" TEST=="/var/run/ConsoleKit/database", \ RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}" ] (whatever is in [...] )to the file and replace "####:####" with the number from step 3cop

  6. sudo service udev restart

  7. Restarted my System

  8. open terminal browse to adb directory and run ./adb devices

And it shows my phone hence adb starts working without error.

I hope it helps others

share|improve this answer
add comment (requires an account with 50 reputation)

I have same problem as you. finally as i know, in linux & mac OS, we use ./adb instead of adb

share|improve this answer
1  
In linux, you can also use adb. You just need add a path to adb command in your environment. You just need to edit bashrc file and add a path to adb command there. It should work fine after that. – VendettaDroid Sep 22 '12 at 10:41
add comment (requires an account with 50 reputation)

출처 : http://stackoverflow.com/questions/2517493/adb-command-not-found-in-linux-environment

728x90

'JAVA' 카테고리의 다른 글

인터넷 없이 android sdk 설치(install android sdk without internet)  (0) 2013.08.06
Troubleshooting ADT Installation  (0) 2013.08.05
ADB(Android Debug Bridge)  (0) 2013.08.02
make boottarball 에러  (0) 2013.07.15
javax.mail 수신확인  (0) 2013.07.13

+ Recent posts