6

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?

2
  • I think adb is a pluggin for eclipse. Not obvious when you see an executable in a directory that does not run. I was able to find the Android SDK Manager and run it from eclipse windows...
    – user1727618
    Commented Oct 8, 2012 at 2:49
  • No, adb is a command-line tool. The eclipse plugin is just a graphical interface for it.
    – Sebi
    Commented Oct 8, 2012 at 18:15

3 Answers 3

11

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
  • Glad you got it sorted. Was just about to point you towards itsgreatupnorth.blogspot.com/2010/11/…
    – barry
    Commented Dec 20, 2011 at 20:42
  • that post helped me a ton - thanks for putting that out there. I find it odd that this malfunctions since I'm using Ubuntu 10.04 64-bit - which is the operating system that they recommend for building from source.
    – josh-cain
    Commented Nov 23, 2012 at 1:46
1

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}"

1
  • I already have that. Please my question: I'm not able to run the command without sudo. If I run "sudo ./adb", it works, but not if I just run "./adb" (of course I'm in the correct directory).
    – Sebi
    Commented Dec 20, 2011 at 19:24
0

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.

1
  • I already did that. All files and folders are owned by myuser:myuser. I also tried assigning everything to admin group, so myuser:admin, but also no difference.
    – Sebi
    Commented Dec 20, 2011 at 20:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.