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?

Sebi
  • 8,323
  • 6
  • 48
  • 76
  • 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... –  Oct 08 '12 at 02:49
  • No, adb is a command-line tool. The eclipse plugin is just a graphical interface for it. – Sebi Oct 08 '12 at 18:15

3 Answers3

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.

Sebi
  • 8,323
  • 6
  • 48
  • 76
  • Glad you got it sorted. Was just about to point you towards http://itsgreatupnorth.blogspot.com/2010/11/android-dev-on-64-bit.html?spref=tw – barry Dec 20 '11 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 Nov 23 '12 at 01: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}"

zangeed
  • 214
  • 1
  • 12
  • 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 Dec 20 '11 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.

barry
  • 4,037
  • 6
  • 41
  • 68
  • 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 Dec 20 '11 at 20:23