可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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
回答1:
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 is required just type following command -
adb devices
To make sure it's working.
回答2:
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 android-sdk/tools/
, rather in android-sdk/platform-tools/
.
So I added the following
export PATH=${PATH}:/path/to/android-sdk/tools:/path/to/android-sdk/platform-tools
And that solved the problem for me.
回答3:
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
回答4:
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.
回答5:
sudo apt install adb
in your pc adb not installed.
Try this, working for me
回答6:
You need to add $ANDROID_SDK/platform-tools
to your PATH
, where $ANDROID_SDK
is wherever you installed the Android SDK.
回答7:
Follow these steps:
Set android vars
Initially go to your home and press `Ctrl + H` it will show you hidden files now look for .bashrc file, open it with any text editor
then place the lines below at the end of file:
export ANDROID_HOME=/myPathSdk/android-sdk-linux
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Now Reboot the system
It Works!
回答8:
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 dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
回答9:
I have same problem as you. finally as i know, in linux & mac OS, we use ./adb instead of adb
回答10:
The way I fix this problem is:
- create a link from adb file(drag 'adb' with holding alt then drop to any directory and select 'link here')
- 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).
回答11:
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.
回答12:
I had this problem when I was trying to connect my phone and trying to use adb. I did the following
export PATH=$PATH{}:/path/to/android-sdk/tools:/path/to/android/platform-tools
apt-get install ia32-libs
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.
sudo gedit /etc/udev/rules.d/99-android.rules
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
sudo service udev restart
Restarted my System
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
回答13:
Make sure you installed sudo apt-get install android-tools-adb Now check sudo adb It will show help of adb
Now please kill/start adb use following commands -
sudo adb kill-server sudo adb start-server
Lastly, sudo adb devices
Hopefully this will work !!!
回答14:
In my case "adb" is located in "~/Android/Sdk/platform-tools/"
the following command solved the problem:
export PATH=$PATH:~/Android/Sdk/platform-tools/
回答15:
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
回答16:
I was getting this error also and Ubuntu suggested me to install it so I installed* it and this worked in my case.
* - sudo apt-get install android-tools-adb
Note:x64 architecture
回答17:
creating a symbolic link was the solution for me either. However before working I had to grant access and execute rights to the created symbolic links.
I am not sure if it was @eaykin's answer or @crazymacleod's that worked for me, as I did both before finding the above mentioned solution.
Thanks!
回答18:
In Ubuntu i could run the following command:
sudo apt install android-tools-adb