Wednesday, September 5, 2012

Run Android SDK in 64-bit Ubuntu 12.04

When installing the Android SDK on a pure 64-bit Ubuntu system, I noticed that the tools and platform toold didn't run:
/opt/android-sdk-linux $ ./platform-tools/adb

bash: ./platform-tools/adb: No such file or directory

The files are executable and binaries, but compiled for 32-bit environments:
/opt/android-sdk-linux $ file ./platform-tools/adb

/opt/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

Trying to find out the usual way, which 32-bit libraries it needs, did not work:
/opt/android-sdk-linux $ ldd ./platform-tools/adb

not a dynamic executable

Searching through several posts on the Internet, people recommended to install the whole set of 32-bit compatibility libraries in the form of the ia32-libs-multiarch package. This would have pulled in 230 new packages with all kinds of 32-bit libraries, and I did not care for this all that much.

So I tried to manually install just the lib32stdc++6 package (pulling in 2 more packages and 4 MB worth of data). Then I re-ran the ldd command to find out what else was needed:
/opt/android-sdk-linux $ ldd ./platform-tools/adb

        linux-gate.so.1 =>  (0xf77b2000)
        librt.so.1 => /lib32/librt.so.1 (0xf7795000)
        libncurses.so.5 => not found
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf777a000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7695000)
        libm.so.6 => /lib32/libm.so.6 (0xf766a000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf764b000)
        libc.so.6 => /lib32/libc.so.6 (0xf74a9000)
        /lib/ld-linux.so.2 (0xf77b3000)

Only the libncurses.so.5 is still missing! Yaay. After installing lib32ncurses5 (pulling in one dependency and 200 KB), the adb and fastboot tools launched fine:
/opt/android-sdk-linux $ ./platform-tools/adb version

Android Debug Bridge version 1.0.29

No comments:

Post a Comment