'No command 'adb' found' error on

2019-02-12 10:50发布

I just got a brand new Ubuntu machine and I am trying to setup Android SDK. I am pretty new to Unix so pardon me if I did a silly mistake.

I followed the instructions given here, all the way up to adding the 'Rule' file. Now if I try adb devices in the terminal, it gives me 'No command 'adb' found' error and asks if I made a spelling mistake.

@USER:~/android-sdk-linux/platform-tools$ ls
NOTICE.txt  adb  api  fastboot  source.properties  systrace
@USER:~/android-sdk-linux/platform-tools$ adb devices
No command 'adb' found, did you mean:
 Command 'cdb' from package 'tinycdb' (main)
 Command 'gdb' from package 'gdb' (main)
 Command 'dab' from package 'bsdgames' (universe)
 Command 'zdb' from package 'zfs-fuse' (universe)
 Command 'kdb' from package 'elektra-bin' (universe)
 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 'openjdk-7-jdk' (universe)
 Command 'ab' from package 'apache2-utils' (main)
 Command 'ad' from package 'netatalk' (universe)
adb: command not found

I searched through a couple of questions on StackOverflow and some suggest I use apt-get install ia32-libs command to get some 32-bit libraries. However, I am on a 64-bit machine so not sure whether I should go for that or not.

Another strange issue I noticed is, even if I navigate to the platform-tools folder and execute adb devices command, I get the same error. So, I might be missing something else here rather than incorrectly setting the PATH entry.

I tried both the ADB BUNDLE (.zip file) and SDK tools (.tgz file) from the download page and completed all the steps mentioned above but got same error.

I am on Ubuntu 12.04 LTS.

5条回答
一纸荒年 Trace。
2楼-- · 2019-02-12 11:01

You are in the right directory but the current directory is not in your shell's command search path.

Try

./adb

Also search Google for how to set $PATH variable in bash

Type the following into your terminal (from your help.ubuntu.com URL) - it will temporarily add the android tool directories into your PATH for that shell/terminal

export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

You should now be able to run adb (without being in the right dir and without using ./adb)

If you add those commands into your .bashrc and start a new terminal/shell you should find those changes are now permanent.

查看更多
再贱就再见
3楼-- · 2019-02-12 11:02

I'm not sure what this line did and why I had to do that ('cuz the blogs say its some 32-bit libraries and I am on a 64-bit machine). But it seems to be working for me.

sudo apt-get install ia32-libs

When I executed this command, it installed/added some stuff for about 5 minutes (literally) and then everything worked.

Regards, Rumit

查看更多
Fickle 薄情
4楼-- · 2019-02-12 11:09

(My system is ubuntu 16.10)

This will make the android studio to find the adb-->

1) Open with gedit: (ref:https://askubuntu.com/questions/127056/where-is-bashrc)

gedit ~/.bashrc

2) Add this line to the bottom of your.bashrc and it works.

export PATH=$PATH:$HOME"/android-sdk-linux/platform-tools" (ref: https://askubuntu.com/questions/652936/adding-android-sdk-platform-tools-to-path-downloaded-from-umake)

Restart the android studio

查看更多
Rolldiameter
5楼-- · 2019-02-12 11:19

Make sure you installed:

sudo apt-get install android-tools-adb

Now check:

sudo adb

It will show adb help.

Now please kill/start adb. Use the following commands:

sudo adb kill-server
sudo adb start-server

Lastly, do:

sudo adb devices

This should work.

查看更多
小情绪 Triste *
6楼-- · 2019-02-12 11:24

In platform-tools folder "adb" is available then 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!

查看更多
登录 后发表回答