Post Reply

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

7th January 2011, 09:43 PM   |  #1  
momashi's Avatar
OP Member
Flag Montreal
Thanks Meter: 9
 
52 posts
Join Date:Joined: Oct 2010
More
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....eADB64bitLinux

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/q42gek...e-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 by momashi; 7th January 2011 at 10:04 PM.
The Following 2 Users Say Thank You to momashi For This Useful Post: [ View ]
7th January 2011, 10:58 PM   |  #2  
Romanbb's Avatar
Recognized Developer
Thanks Meter: 7,029
 
3,587 posts
Join Date:Joined: Sep 2009
Donate to Me
More
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
7th January 2011, 11:58 PM   |  #3  
Romanbb's Avatar
Recognized Developer
Thanks Meter: 7,029
 
3,587 posts
Join Date:Joined: Sep 2009
Donate to Me
More
http://forum.xda-developers.com/showthread.php?t=537508

(skip the last part about setting up fastboot)

except on this step:
Quote:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

You need to do lsusb in console (with your phone plugged in) and find the Samsung vendor id, it's like 0ed4 or something, I don't remember.

Much easier, I think.
8th January 2011, 03:28 AM   |  #4  
Senior Member
Thanks Meter: 25
 
379 posts
Join Date:Joined: Jul 2010
More
Quote:
Originally Posted by birgertime

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.
8th January 2011, 04:48 PM   |  #5  
Recognized Developer
Flag Gilbert, AZ
Thanks Meter: 2,009
 
2,299 posts
Join Date:Joined: Oct 2009
Donate to Me
More
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
10th January 2011, 06:32 PM   |  #6  
JeepFreak's Avatar
Senior Member
Thanks Meter: 206
 
690 posts
Join Date:Joined: May 2008
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 are appreciated!
31st January 2011, 02:21 PM   |  #7  
GJSmith3rd's Avatar
Senior Member
Flag Chicago
Thanks Meter: 26
 
343 posts
Join Date:Joined: May 2008
More
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 by GJSmith3rd; 1st February 2011 at 12:05 AM. Reason: Afterthought
31st January 2011, 03:00 PM   |  #8  
Member
Thanks Meter: 4
 
36 posts
Join Date:Joined: Aug 2010
Quote:
Originally Posted by JeremyNT

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!
31st January 2011, 05:03 PM   |  #9  
phattchumpy's Avatar
Member
Flag Seattle
Thanks Meter: 3
 
49 posts
Join Date:Joined: Oct 2010
More
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
31st January 2011, 06:13 PM   |  #10  
Member
Thanks Meter: 0
 
35 posts
Join Date:Joined: Aug 2010
I'm pretty sure that you only have to give it root on the first time.

Sent from my SGH-T959 using Tapatalk

Post Reply Subscribe to Thread

Tags
64bit, adb, linux, ubuntu, x64
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Vibrant Android Development by ThreadRank