• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[HOW-TO] Setup ADB on Ubuntu Linux 64Bit

Search This thread

momashi

Senior Member
Oct 21, 2010
52
9
Montreal
As you all may know (or may not know or may not even care), Google's current implementation of ADB for Linux only works on 32Bit Linux systems (boooh!) which leaves the rest of us x64 users with the dilemma of either installing an extra redundant 32bit version of Ubuntu that will hord 15Gb of space so that we may type a few ADB commands in the bash prompt or install ADB on Windows for those of us that have it. Ever since I bought my phone and was forced to reboot my beloved free OS to type those few commands, I'd wave my fists in the air and curse Google for not having had enough sense to make a 64Bit implementation.

Fortunately, my fists will need tire themselves no more. Using a guide compiled by a Geeksphone.com forum user called Talpa, I was able to successfully compile and run ADB on a Linux 64Bit system in short order. Little things make me happy and having seen that this technique is not very wide spread on the forums, I've decided to spread the happiness myself...

CREDITS:
Big, big thanks to the users of the geeksphone forums for having pooled their time, skills and efforts together to figure out this hack and a another big thank you to talpa for having sifted through all the of posts and having made a coherent and unified guide out of it. The guide can be originally found at:

http://wiki.geeksphone.com/en/index.php?title=CompileADB64bitLinux

the discussion that lead to the guide is at:
http://forum.geeksphone.com/index.php?topic=850.0


ADB Linux 64Bit (yeeehhhaaaah!!!)
For the sake of added clarity, I've completely rewrote the geeksphone guide. go to your terminal

#> sudo su
#> mkdir /tmp/my-adb
#> cd /tmp/my-adb

if you don't already have it, install git-core:

#>apt-get install git-core

once that's done, type out the following commands:

#> git clone git://android.git.kernel.org/platform/system/core.git system/core
#> git clone git://android.git.kernel.org/platform/build.git build
#> git clone git://android.git.kernel.org/platform/external/zlib.git external/zlib
#> git clone git://android.git.kernel.org/platform/bionic.git bionic

Before you run compile, you need to the following alterations to the compile scripts to make the output bianaries 64bit compatible. As time progress and this post ages in the ageless internet, some additional modifications may be necessary (or they may change the place of the offending code or may add new bits that need to be deleted or changed). You can go back to the GeeksPhone wiki link (up above) to see if the forum members there have updated it. Hopefully by then, Google would have compiled a 64Bit Linux version of ADB and all of this would be unnecessary. If for any reason you're unable or unwilling to modify the source code yourself, go to this link where I have posted the source code that I have modified:

http://www.mediafire.com/file/q42gektqr32nr31/adb-Linux64bit-source-code-jan-2011.zip



Editing the Source Code Yourself


first, edit the file /tmp/my-adb/build/target/product/sdk.mk and delete the last six lines:

==============================

# include available languages for TTS in the system image
include external/svox/pico/lang/PicoLangDeDeInSystem.mk
include external/svox/pico/lang/PicoLangEnGBInSystem.mk
include external/svox/pico/lang/PicoLangEnUsInSystem.mk
include external/svox/pico/lang/PicoLangEsEsInSystem.mk
include external/svox/pico/lang/PicoLangFrFrInSystem.mk
include external/svox/pico/lang/PicoLangItItInSystem.mk

==============================

then, edit the file /tmp/my-adb/build/core/main.mk at line 116 (again the position may change, just keep an eye out for the offending code) and erase the following lines:

==============================

# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************** **********)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info ************************************************** **********)
$(error stop)
endif

# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************** **********)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info ************************************************** **********)
$(error stop)
endif

==============================

Edit /tmp/my-adb/build/core/combo/HOST_linux-x86.mk and change every "-m32 string" to "m64"

Now that that's done, you should be able to get the compiling going with the following command:

#> make -f build/core/main.mk out/host/linux-x86/bin/adb

Once that's done, you go to /tmp/my-adb/out/host/linux-x86/bin/ and you get your adb and acp binaries and move them to wherever your OS keeps all the system binaries.

In ubuntu 10.04, that would be
/bin/adb
/bin/acp

That's it, adb should work from your 64 bit linux shell.


==========================
 
Last edited:
  • Like
Reactions: dakunesu and geekoo

Romanbb

Inactive Recognized Developer
Sep 18, 2009
3,594
6,961
Seattle
aokp.co
Holy hell that looks overly complicated. I've installed adb about a dozen times on x64 Ubuntu. I'll post a link to the guide i was using in a minute...

Sent from my SGH-T959 using Tapatalk
 

JeremyNT

Senior Member
Jul 22, 2010
383
25
Holy hell that looks overly complicated. I've installed adb about a dozen times on x64 Ubuntu. I'll post a link to the guide i was using in a minute...

Sent from my SGH-T959 using Tapatalk

Um, yeah, I don't know why the OP is doing all this. All you need to do is download the android SDK for your platform:

http://developer.android.com/sdk/index.html

An adb binary is included in the tarball in the tools directory. Just add that to your path somewhere.

Yes, the binary included in the SDK is 32bit. No, it doesn't matter at all. A clean install of 64-bit Ubuntu includes multilib support for the (very few) 32-bit shared libraries it requires.

If you really, really need a 64-bit binary... well, go for it. But unless you're building your own Linux distribution or are doing something really exotic, it's highly likely that the 32-bit version will work just fine.
 

dasunsrule32

Inactive Recognized Developer
Oct 9, 2009
2,336
2,066
Gilbert, AZ
Yikes! This is overkill. Dude, just install the lib32 library files. You should really read the Android developers page on how to setup the sdk on 64-bit linux, its all there. ;-) Good luck with this though. :) Really...

Sent from my SGH-T959 using XDA App
 

JeepFreak

Senior Member
May 17, 2008
768
223
Google Pixel 4a 5G
I thought some people might appreciate the instructions to get adb working over WiFi too and this seems like a good place to put it:

Type this in your terminal emulator on your Android device:
Code:
setprop service.adb.tcp.port 5555
stop adbd
start adbd

Then check it with this:
Code:
getprop service.adb.tcp.port

If it doesn't return "5555" and you're rooted, then do a "su" command and try again. You shouldn't need to be rooted for adb over wifi to work, but I haven't tried every device:
Code:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

Then check it:
Code:
getprop service.adb.tcp.port

When it returns "5555" then run this command in the terminal (or command prompt) on your computer:
Code:
adb connect 192.168.0.151
(Obviously enter your device's IP address. You must be on the same network as the computer that has the Android SDK installed.)

And you should be connected!

To tell the Android device to listen for adb on the USB port instead of TCP again, enter this into the terminal emulator:
Code:
setprop service.adb.tcp.port -1
stop adbd
start adbd
(again, might need "su" on your device)

Or just reboot the Android device.

And to tell your computer to use USB for adb instead of TCP:
Code:
adb usb

Now, keep in mind, when your Android device is listening for adb via WiFi, it's wide open... anybody that that the Android SDK installed and knows your device's IP address can access it without a password.

HTH,
Billy

PS - Your
thanks.jpg
are appreciated! ;)
 

GJSmith3rd

Senior Member
May 6, 2008
429
53
Chicago
Yes, I just installed a clean Ubuntu 64 bit and the lib32 binaries were included. I only needed to create a /etc/udev/rules.d/70-android.rules and enter my device ID - SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666". I can connect via ADB 32 bit just fine.

Of course using 64 bit drivers falls under the I did it because I could category as well. Kudos!
 
Last edited:

guruchimi

Member
Aug 27, 2010
36
4
Um, yeah, I don't know why the OP is doing all this. All you need to do is download the android SDK for your platform:

http://developer.android.com/sdk/index.html

An adb binary is included in the tarball in the tools directory. Just add that to your path somewhere.

Yes, the binary included in the SDK is 32bit. No, it doesn't matter at all. A clean install of 64-bit Ubuntu includes multilib support for the (very few) 32-bit shared libraries it requires.

If you really, really need a 64-bit binary... well, go for it. But unless you're building your own Linux distribution or are doing something really exotic, it's highly likely that the 32-bit version will work just fine.


Exactly my thoughts as well. It is simple enough to get it working using the standard package that Android provides!
 

phattchumpy

Member
Oct 21, 2010
49
3
Seattle
Like others have said adb packaged with the android sdk works fine on ubuntu 10.10 with no additional configuration. The only problem that I know of is you have to run the adb server as root.

Sent from my SGH-T959 using XDA App
 

guruchimi

Member
Aug 27, 2010
36
4
Like others have said adb packaged with the android sdk works fine on ubuntu 10.10 with no additional configuration. The only problem that I know of is you have to run the adb server as root.

Sent from my SGH-T959 using XDA App

I am able to run the adb server with a user login with guest permissions. Did not have to use root. But I run Ubuntu 10.04. I guess that it would probably be the same for 10.10 as well, but can't confirm.
 

the3dman

Senior Member
Sep 5, 2007
657
99
Chicago :(
www.the3dman.com
This is what I do (very simple and fast)

1) Open the terminal and type: wget dl.google.com/android/android-sdk_r07-linux_x86.tgz (Downloads The SDK with ADB)

2) Then type: tar xvfz android-sdk_r07-linux_x86.tgz && cd android-sdk-linux_x86 (Extracts the archive)

3) After that type: sudo mv tools /usr/local/share/android-tools (Moves the sdk tools to your local system folder)

4) Now type: sudo ln -s /usr/local/share/android-tools/adb /usr/local/bin/ (Makes a symbolic link to the adb executable)

5) Then type: sudo adb devices (This will start the adb server and search for connected devices)

You should now see this in your terminal:
List of devices attached
T959730f48f7 device
 

geekoo

Senior Member
Jul 1, 2009
127
60
Bangalore
Firstly, Thanks a lot to the OP for posting this and the link to the geeksphone wiki. I really needed this and I would have removed my existing linux install, had I not come across this in the next few minutes.

Now back to the main reason why I am posting this comment.
I didn't see even one single reply that was grateful to the OP and the first many posts were just plain crap. If you people don't know what someone is talking about, then please don't show your ignorance and move on to troll other threads.

Of course you can install adb from the default google sdk package and it would work fine on 99% of your systems. It is the remaining 1% for whom this post is intended.

This method is for those who have a pure non-multilib 64-bit system. For such users, google has not packaged a 64-bit adb file in their release, and the default adb will not work. Such users have to build the adb file for a 64-bit machine from the sources. It is for such users that this is necessary and it was very much necessary for me, as well as for the OP, I presume.

So if you don't understand something, please don't waste others' time by spamming the post. The title is quite obvious to those who are looking for a solution.

Update: Just as I finished typing this, my adb has got compiled and I am able to run it. Thanks a million once again, OP.
 
  • Like
Reactions: bigrammy

yo9gnc

Senior Member
May 26, 2010
226
10
Bucharest
Firstly, Thanks a lot to the OP for posting this and the link to the geeksphone wiki. I really needed this and I would have removed my existing linux install, had I not come across this in the next few minutes.

Now back to the main reason why I am posting this comment.
I didn't see even one single reply that was grateful to the OP and the first many posts were just plain crap. If you people don't know what someone is talking about, then please don't show your ignorance and move on to troll other threads.

Of course you can install adb from the default google sdk package and it would work fine on 99% of your systems. It is the remaining 1% for whom this post is intended.

This method is for those who have a pure non-multilib 64-bit system. For such users, google has not packaged a 64-bit adb file in their release, and the default adb will not work. Such users have to build the adb file for a 64-bit machine from the sources. It is for such users that this is necessary and it was very much necessary for me, as well as for the OP, I presume.

So if you don't understand something, please don't waste others' time by spamming the post. The title is quite obvious to those who are looking for a solution.

Update: Just as I finished typing this, my adb has got compiled and I am able to run it. Thanks a million once again, OP.
damn!
The adb tool has moved to platform-tools/

If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"

Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
ofcourse they meved it. so ... any new tutorial with android sdk ?
in windows is the same problem with missing adb.exe (but i have an older version installed). just that i use windows for starcraft2 :) so i want adb for linux (eventually x64).

later edit: found it ->scroll down to platform tools
and after:
extract in a folder, cd to that folder
$sudo apt-get install lib32ncurses5 lib32stdc++6
# echo SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666">/etc/udev/rules.d/51-android.rules
$./adb kill-server
$./adb start-server
(kill and start i don`t know if is necessary, but it can`t do nothing wrong)
connect the device, $./adb devices and shall see it.
$./adb shell and enjoy

$ => as regular user
# => as root
i`m on kubuntu 12.04 (x64) and using an android 2.3.7 (cm7 based) huawei u8180 / orange stockholm
 
Last edited:

Rushing

Senior Member
Jan 13, 2012
2,295
2,893
Los Angeles
even easier

even easier paste these commands in linux terminal


sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot



btw # < $
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    As you all may know (or may not know or may not even care), Google's current implementation of ADB for Linux only works on 32Bit Linux systems (boooh!) which leaves the rest of us x64 users with the dilemma of either installing an extra redundant 32bit version of Ubuntu that will hord 15Gb of space so that we may type a few ADB commands in the bash prompt or install ADB on Windows for those of us that have it. Ever since I bought my phone and was forced to reboot my beloved free OS to type those few commands, I'd wave my fists in the air and curse Google for not having had enough sense to make a 64Bit implementation.

    Fortunately, my fists will need tire themselves no more. Using a guide compiled by a Geeksphone.com forum user called Talpa, I was able to successfully compile and run ADB on a Linux 64Bit system in short order. Little things make me happy and having seen that this technique is not very wide spread on the forums, I've decided to spread the happiness myself...

    CREDITS:
    Big, big thanks to the users of the geeksphone forums for having pooled their time, skills and efforts together to figure out this hack and a another big thank you to talpa for having sifted through all the of posts and having made a coherent and unified guide out of it. The guide can be originally found at:

    http://wiki.geeksphone.com/en/index.php?title=CompileADB64bitLinux

    the discussion that lead to the guide is at:
    http://forum.geeksphone.com/index.php?topic=850.0


    ADB Linux 64Bit (yeeehhhaaaah!!!)
    For the sake of added clarity, I've completely rewrote the geeksphone guide. go to your terminal

    #> sudo su
    #> mkdir /tmp/my-adb
    #> cd /tmp/my-adb

    if you don't already have it, install git-core:

    #>apt-get install git-core

    once that's done, type out the following commands:

    #> git clone git://android.git.kernel.org/platform/system/core.git system/core
    #> git clone git://android.git.kernel.org/platform/build.git build
    #> git clone git://android.git.kernel.org/platform/external/zlib.git external/zlib
    #> git clone git://android.git.kernel.org/platform/bionic.git bionic

    Before you run compile, you need to the following alterations to the compile scripts to make the output bianaries 64bit compatible. As time progress and this post ages in the ageless internet, some additional modifications may be necessary (or they may change the place of the offending code or may add new bits that need to be deleted or changed). You can go back to the GeeksPhone wiki link (up above) to see if the forum members there have updated it. Hopefully by then, Google would have compiled a 64Bit Linux version of ADB and all of this would be unnecessary. If for any reason you're unable or unwilling to modify the source code yourself, go to this link where I have posted the source code that I have modified:

    http://www.mediafire.com/file/q42gektqr32nr31/adb-Linux64bit-source-code-jan-2011.zip



    Editing the Source Code Yourself


    first, edit the file /tmp/my-adb/build/target/product/sdk.mk and delete the last six lines:

    ==============================

    # include available languages for TTS in the system image
    include external/svox/pico/lang/PicoLangDeDeInSystem.mk
    include external/svox/pico/lang/PicoLangEnGBInSystem.mk
    include external/svox/pico/lang/PicoLangEnUsInSystem.mk
    include external/svox/pico/lang/PicoLangEsEsInSystem.mk
    include external/svox/pico/lang/PicoLangFrFrInSystem.mk
    include external/svox/pico/lang/PicoLangItItInSystem.mk

    ==============================

    then, edit the file /tmp/my-adb/build/core/main.mk at line 116 (again the position may change, just keep an eye out for the offending code) and erase the following lines:

    ==============================

    # Check for the correct version of java
    java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
    ifeq ($(strip $(java_version)),)
    $(info ************************************************** **********)
    $(info You are attempting to build with the incorrect version)
    $(info of java.)
    $(info $(space))
    $(info Your version is: $(shell java -version 2>&1 | head -n 1).)
    $(info The correct version is: 1.6.)
    $(info $(space))
    $(info Please follow the machine setup instructions at)
    $(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
    $(info ************************************************** **********)
    $(error stop)
    endif

    # Check for the correct version of javac
    javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
    ifeq ($(strip $(javac_version)),)
    $(info ************************************************** **********)
    $(info You are attempting to build with the incorrect version)
    $(info of javac.)
    $(info $(space))
    $(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
    $(info The correct version is: 1.6.)
    $(info $(space))
    $(info Please follow the machine setup instructions at)
    $(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
    $(info ************************************************** **********)
    $(error stop)
    endif

    ==============================

    Edit /tmp/my-adb/build/core/combo/HOST_linux-x86.mk and change every "-m32 string" to "m64"

    Now that that's done, you should be able to get the compiling going with the following command:

    #> make -f build/core/main.mk out/host/linux-x86/bin/adb

    Once that's done, you go to /tmp/my-adb/out/host/linux-x86/bin/ and you get your adb and acp binaries and move them to wherever your OS keeps all the system binaries.

    In ubuntu 10.04, that would be
    /bin/adb
    /bin/acp

    That's it, adb should work from your 64 bit linux shell.


    ==========================
    1
    Firstly, Thanks a lot to the OP for posting this and the link to the geeksphone wiki. I really needed this and I would have removed my existing linux install, had I not come across this in the next few minutes.

    Now back to the main reason why I am posting this comment.
    I didn't see even one single reply that was grateful to the OP and the first many posts were just plain crap. If you people don't know what someone is talking about, then please don't show your ignorance and move on to troll other threads.

    Of course you can install adb from the default google sdk package and it would work fine on 99% of your systems. It is the remaining 1% for whom this post is intended.

    This method is for those who have a pure non-multilib 64-bit system. For such users, google has not packaged a 64-bit adb file in their release, and the default adb will not work. Such users have to build the adb file for a 64-bit machine from the sources. It is for such users that this is necessary and it was very much necessary for me, as well as for the OP, I presume.

    So if you don't understand something, please don't waste others' time by spamming the post. The title is quite obvious to those who are looking for a solution.

    Update: Just as I finished typing this, my adb has got compiled and I am able to run it. Thanks a million once again, OP.