adb doesn't run on Ubuntu 64 - command not found

邮差的信 提交于 2019-12-09 17:39:06

问题


Update

After doing some more experiments, I have to reformulate my question completely as I was fooled by my terminal. It just didn't showed the error message when I issued sudo ./adb.

If I cd into the ANDOID_SDK/platform-tools directory and run ./adb, I get:

command not found: ./adb

Here the output ls -l adb in the same directory:

-rwxrwxr-x 1 myuser myuser 159620 2011-12-20 19:30 adb

Running which adb gives me:

./adb

The same happens for all other binary executable files in that directory like aapt, aidl, dexdump, etc.

I could just imagine that this has something to do with me trying to run it on a 64bit Ubuntu, but the ELF header or something similar not being recognised. However, the android tool in ANDOID_SDK/tools is running fine (besides failing to execute adb after downloading new packages).

Really strange...

Original question

I downloaded the latest Android SDK. If I try running adb as an ordinary user, I get "command not found". I must run it as "sudo ./adb" and it works. Why is that and how do I fix it? I'm running Ubuntu 64 11.10.

I used the SDK on older Ubuntu versions and there, I could run it as ordinary user without problems. Any ideas?


回答1:


I found the solution. I investigated again if I really got ia32-libs installed. On a first glance, it looked fine in aptitude. However, on a second glance I noticed that the ia32-libs package was installed, but not all dependencies. I was not able to resolve that with aptitude, but instead I had to remove ia32-libs with KDE package manager and install it again. Now, all missing 88 dependencies were installed, too. adb is now working fine.

I'm not 100% sure why aptitude failed here, but I suspect that it is suffering from this bug on my installation, too: https://bugs.launchpad.net/ubuntu/+source/aptitude/+bug/831768 I also have duplicate entries in aptitude for all entries.




回答2:


Add platform-tools to environmental variable,for that

Append the following line to last of the /home/yourUserName/.bashrc file in your home folder..

export PATH="your/path/android-sdk-linux/platform-tools/:${PATH}"




回答3:


Run 'chown' on the android sdk folder to make your user account the owner of the folder. It sounds like it's owned by the root user at the moment. I can't remember the syntax, but there'll be plenty of examples online.



来源:https://stackoverflow.com/questions/8580694/adb-doesnt-run-on-ubuntu-64-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!