9

I'm running ArchLinux, kernel 3.4.4, bash version 4.2.29. I downloaded the android sdk from here: http://developer.android.com/sdk/index.html

Once extracted I did, did ~/android-sdk-linux/tools/android and installed the SDK platform tools package.

From there I tried the following:

> ls -l ~/android-sdk-linux/platform-tools/adb 
-rwxr-xr-x 1 mediocregopher mediocregopher 204436 Jun 28 13:20 /home/mediocregopher/android-sdk-linux/platform-tools/adb

> file ~/android-sdk-linux/platform-tools/adb 
/home/mediocregopher/android-sdk-linux/platform-tools/adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

> ~/android-sdk-linux/platform-tools/adb 
bash: /home/mediocregopher/android-sdk-linux/platform-tools/adb: No such file or directory

Clearly the file is there and at the very least executable, why can't bash seem to find it? I've tried adding the platform-tools folder to my path as well as sudo and su-ing, but no matter what it seems like the file is not found. Does anyone know what could be happening?

Mediocre Gopher
  • 2,274
  • 1
  • 22
  • 39

2 Answers2

17

You're running on a 64bit system and you do not have the 32bit compatibility libraries installed.

The error is actually coming from the fact that it can't find the 32bit ld.so.

If you're using ubuntu/debian, I think you just need to sudo apt-get install ia32-libs and it should work.

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122
  • +1 This is the far less common reason for ENOENT from an [execve(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/execve.2.html) – pilcrow Jun 28 '12 at 17:57
  • 1
    This ended up being the problem. I had found android-sdk in arch's AUR but couldn't get it to install because it needed a bunch of lib32-* packages. Turns out I just needed to enable the multilib repo. Thanks for pointing me in the right direction :) – Mediocre Gopher Jun 28 '12 at 18:10
  • 1
    [Installing the Android SDK](http://developer.android.com/sdk/installing/index.html?pkg=tools) explains this under "Troubleshooting Ubuntu." – reergymerej Jul 05 '14 at 19:56
9

For 'modern' versions of Ubuntu (13.10 and higher), the accepted answer is not working anymore: They removed the '32 bit compability libraries' and instead you need to use multiarch packages that happily coexists next to each other. See What happened to the ia32-libs package? on AskUbuntu.

Instead you need to install the 32 bit version of libc:

sudo apt-get install libc6:i386

Next, I encounterd that a 32 bit version of libstdc++ is also required by adb:

sudo apt-get install libstdc++6:i386

Now adb should be working (again).

Android SDK on a 64-bit linux machine shows that some other libraries are required as well. I did not seem to require them as well, but might have had them installed already.

Community
  • 1
  • 1
Veger
  • 37,240
  • 11
  • 105
  • 116