yashsingh1/xdaforums huggingface dataset:
[Raspberry Pi Development] cdesai:
An adb binary is built for the device already by default, it lives under /system/bin/adb.

So, just grab one from your device and use it (if you get around the linking problems), or compile it.

Setup your pc for building android (source.android.pc), and get AOSP master.

Once done, select any suitable target (type lunch to get a list).

make $OUT/system/bin/adb will do the job.

[ /home/cdesai/android/cm/10/out/target/product/p1/system/bin/adb: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped ] - so you'll need to force it to be static, do that at system/core/adb/Android.mk (https://android.googlesource.com/platform/system/core/+/master/adb/Android.mk - line 134)
[Raspberry Pi Development] AdamOutler:
That looks like what I need, and I tried to grab the binary, then link in the dependencies to debian, but it didn't work.

here is "file /bin/adb" which is a working, but older copy of adb for raspi.

/bin/adb: setuid setgid ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.26, BuildID[sha1]=0x8ffd8c80a0705dc113149612e3067931208bfd70, not stripped

Unfortunately, I don't really understand what is required to bend that Makefile. My knowledge limits end at specifying build folders, adding CC flags, and adding/removing tags... you know, the standard build-it-yourself stuff. I only really understand C Headers.
[Raspberry Pi Development] AdamOutler:
I found this command bugreport

pi@raspberrypi ~/adb $ ./adb bugreport
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/commandline.c::adb_commandline():interactive shell loop. buff=shell:bugreport
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/adb_client.c::adb_connect():adb_connect: service shell:bugreport
* daemon not running. starting it now on port 5038 *
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
system/core/adb/commandline.c::adb_commandline():interactive shell loop. return r=-1

Looks like it is having a problem instantiating a new shell process?
[Raspberry Pi Development] E:V:A:
A couple of things:

Make sure you don't have a firewall blocking adb

If you're on windows make sure you don't have a defunct adb already running. (Check with task-manager and kill it.) And make sure you run it as administrator.

Make sure USB Debugging is enabled in the device (if available)

If you are using Ubuntu, add your USB vendor ID (VID) to the file 51-android.rules. See here for more details. Then do this:

sudo ./adb kill-server
sudo ./adb start-server

Not sure if any of this helps, since I have no idea of what you're doing or how your setup looks...
[Raspberry Pi Development] AdamOutler:
I have a working copy on my system but it's old. I need a new copy of adb for the adb restore command. it has to be built for arm and statically linked
[Raspberry Pi Development] AdamOutler:
I asked JBQ on G+ and he offered this..
[Raspberry Pi Development] bhundven:
Good idea. I don't have a pi (although I really want one), or I would offer more help.
[Raspberry Pi Development] Foamyguy:
Little help

From what I can gather you've got an older version of ADB that is working correctly on the RasPi but you are trying to compile a newer version.

I have thus far been unable to make any version of it work on my raspberry pi.

Is there any chance that you could post a link to the older (working) adb binary that runs on Raspberry pi?

Also (sorry, still a bit of a noob in this space) once I've got a binary what would I need to do to make it run? I've tried 3 different ones that I've found linked in threads on this topic(including the one that trevd posted at the top of page 3) and have had no success yet.

I've been pasting them in /usr/local/bin/ I also added a 99-android.rules file to /etc/udev/rules.d/ Once I do those if I try to run an adb command I get either "Segmentation Fault" or "Illegal Instruction". The latter is what I get from the binary that trevd posted.

Is there something else I need to do to get this set up? I am not looking to do anything fancy yet, just want to be able to get an adb command to execute properly on the Raspberry Pi.
[Raspberry Pi Development] AdamOutler:
I'm at work so I SFTP'd into my raspi to grab this file. It should be the old one which is not what I am after. This is 1.0.26 and I need 1.0.28 or higher. http://d-h.st/myfiles
[Raspberry Pi Development] Foamyguy:
The link takes me to dev-host home page.
[Raspberry Pi Development] AdamOutler:
Sorry. Here is the proper link for the old version. I'm mobile. http://d-h.st/Nbs
[Raspberry Pi Development] Foamyguy:
No worries, Thank you for posting :)
[Raspberry Pi Development] AdamOutler:
I must try this guide. http://tech-neophyte.blogspot.com/2012_04_01_archive.html?m=1

I hope its not building the 1.0.26 version.
[Raspberry Pi Development] AdamOutler:
https://plus.google.com/104711040110222472212/posts/JHX9sNCDyrn

I will post the binary later.

Thanks TrevD!
[Raspberry Pi Development] trevd:
Not a problem! ( in the end ). It's all part of the android fun and a great little learning experience!

I'm just setting up a git repo for armv6 now, Gotta get me some of that PI.

EDIT: I attached the built binary and here's a hotfile link [adb-129-armv6-static.7z] of the same file for good measure.

Now I can sleep easy :D

EDIT2: Needs to be run as root at the moment, I'm confident I'll be able to remove this requirement with a little more investigation.

EDIT3: After some hacking around with the android build system, I compiled a real adb host using the native toolchain on the pi, I've attached a zip which contain said binary aswell as the makefiles used.
[Raspberry Pi Development] Foamyguy:
Thanks for posting that binary.

aside from running as root is there anything else that would need to be done to get that running on the Raspberry pi? Is it built for a specific raspberry pi image? should it work with the first one from the pi quickstart page?

Whenever I try to run any adb commands the only output I get is "Segmentation Fault"
[Raspberry Pi Development] AdamOutler:
It should work for raspian. You have something wrong with your system. I think you need libusb and that's about it.

However, this binary is incomplete. It should not need sudo to run and even with sudo it's reporting ??????? for certain devices and refusing to do anything. But, this problem will not cause a segmentation fault. Try the default raspian.
[Raspberry Pi Development] trevd:
Hi Folks

If anyone wants to hack on this I've setup an armv6 device tree on github to use the with AOSP source you can clone it to <aosp_sources>/device/generic/armv6 then do

lunch mini_armv6-userdebug && make -j4

It's currently setup to compile to armv5te as adding true armv6 support require modification of build/core/combo/TARGET_linux-arm.mk

It also sets BUILD_TINY_ANDROID := true automatically to only build do a minimal build, what you will end up with is Android image that is bootable on the PI, it will only start /sbin/adbd. ( see below ) :D

Tiny android build time takes about 1 minute on my AMD FX8120 with make -j16 set

I've left what is describe below as a reference. Although It looked like it worked in the end It simply didn't do the job. I'm not fully sure of the reasons why but It's not something I'll be investigating further as It's not the correct way of doing making an adb for a host

A modification has to be made to the the <aosp_sources>/system/core/adb/Android.mk in the aosp tree, this forces the device-as-host version to use port 5037 instead of 5038

# adb host tool for device-as-host
# =========================================================
ifneq ($(SDK_ONLY),true)
include $(CLEAR_VARS)

LOCAL_LDLIBS := -lrt -lncurses -lpthread

LOCAL_SRC_FILES := \
adb.c \
console.c \
transport.c \
transport_local.c \
transport_usb.c \
commandline.c \
adb_client.c \
sockets.c \
services.c \
file_sync_client.c \
get_my_path_linux.c \
usb_linux.c \
utils.c \
usb_vendors.c \
fdevent.c

LOCAL_CFLAGS := \
-g \
-DADB_HOST=1 \
-Wall \
-Wno-unused-parameter \
-D_XOPEN_SOURCE \
-D_GNU_SOURCE

[B]# LOCAL_CFLAGS += -DADB_HOST_ON_TARGET=1
# Removed Adb host on target to for the binary to use the host port 5037 instead of the target host port 5038[/B]

# adb can't be built without optimizations, so we enforce -O2 if no
# other optimization flag is set - but we don't override what the global
# flags are saying if something else is given (-Os or -O3 are useful)
ifeq ($(findstring -O, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif
ifneq ($(findstring -O0, $(TARGET_GLOBAL_CFLAGS)),)
LOCAL_CFLAGS += -O2
endif

LOCAL_MODULE := adb
[B]LOCAL_FORCE_STATIC_EXECUTABLE := true[/B]
LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils, [B]libc[/B]

include $(BUILD_EXECUTABLE)
endif

The highlights are in bold, It's statically linked against aosp libc ( bionic ). You may want to make sure you have ncurses installed on the PI using apt or something similar.

which should make it alright on any distro but as Adam has already noted there are still issues. It really is bit of a dirty hack!

The binary can be found at target/product/armv6/system/bin/adb in the directory you compile android too ( which is normally a directory call "out" in the android source tree )

I am currently running this [ Linaro Tiny Android Script ] on my Pi Emulator, I see how long it take, From what I gather it only grabs a subset of the sources and it should build a real adb host version using the toolchain on the pi.
[Raspberry Pi Development] Foamyguy:
Ok, turns out the adb binaries were not getting copied to my raspberry pi correctly. They were showing up with 3 less bytes than they should've

I was using python pyftpdlib server running on the raspberry pi and FileZilla client running on my PC to transfer the files.

In FileZilla Transfer->Transfer Type was set to auto. I changed it to binary and uploaded the adb binary again. This time it had all of its bytes, and it works properly.

Thanks again for the binaries
[Raspberry Pi Development] trevd:
I've updated post #38 with a proper build of adb for the PI which runs with out root and seems to be working correctly
[Raspberry Pi Development] AdamOutler:
Confirmed. I will update the OP tonight.
[Raspberry Pi Development] Foamyguy:
Awesome work, thanks a ton.

I still have to run

adb start-server

as root otherwise I get "??????????????????" in the list when I run

adb devices

Works like a charm for everything I need though :D
[Raspberry Pi Development] AdamOutler:
That's normal. When your device does not have a udev rule then your system assigns it non-readable permissions to the standard user. You need to configure the system for the device or run as root.
[Raspberry Pi Development] bhundven:
Good job trevd!
[Raspberry Pi Development] lseidman:
Looks good!
[Raspberry Pi Development] TheLastSidekick:
Man the Raspberry Pi has some serious fighting ground now! Nice work!
[Raspberry Pi Development] trevd:
Seems like my work is begining to proceed me :) I wasn't expect to see this on my weekly browse through hack-a-day :laugh:

Right I've had my quarter-hour of EFame, I'm off back into my android platform hole until my Pi arrives :D
[Raspberry Pi Development] Kuya Marc:
Good Morning from The Philippines!

Hello everyone in this forum. Though I'm just a NOOB in this forum, I typically patronize only my blog. This specific XDA Developers Forum, however, strikes one of my projected interests. I received my Raspberry Pi (Model B, 512MB) on Wednesday, and one of my upcoming projects is to have it be the Controller of my Android Fleet.

Android Debug Bridge (ADB) is what I will be needing, but no schedule until November. The actual project is... Running DDMS for 3-10 Android Devices at the same time (average 3 Androids at once), all using ADBwireless. The secondary project is, downloading Google Play updates on one Android and the Raspberry Pi to disburse updates to my Android Fleet.

Though I'm a veteran C/C++ programmer, I'm still too lazy in learning JAVA for Android development, as I've been involved with Linux for 15+ years. (If I had my wish, all of my Android devices would be converted to embedded Linux devices, but I'm still new to the ARM platform.)

As for ADB on Raspberry Pi... What difficulties, if any, should I expect? I've downloaded the compiled ADB files from this forum thread, but not sure when I'm going to 'test' out.

For those that don't know me, I rarely ask for technical support. Traditionally, if I ask for technical support, then something terrible has gone wrong (like a 5-alarm fire, etc.). :)

Have a nice day, everybody!
[Raspberry Pi Development] cdesai:
Building the full Android source code on a raspberry pi isn't a good idea.

Anyways, remove the slash from the end of the line above the line you modified in TARGET_linux-arm.mk
[Raspberry Pi Development] cmoatoto:
I know it's not the best idea but it's quite a challenge...

Why removing the "\" ? If I do so, TARGET_GLOBAL_LDFLAGS will not add $(arch_variant_ldflags) and there is no reason for that.

Can you explain? Thanks for your help !

BTW, the dedicated thread is now http://xdaforums.com/showthread.php?t=2125278
[Raspberry Pi Development] 5959823882589924:
HI all,

I have been using the binary provided by AdamOutler on my pi for a while now with out a problem, though today I updated my nexus 4 to 4.2.2 and now I am not able to adb into my device.

I think that this is not working due to the USB Debug Whitelist now implemented in 4.2.2. Does anyone know away to get this to work as I am not receiving a pop up on my device asking me if i wish to add the pi to a white list ?

Thanks
[Raspberry Pi Development] io53:
You need a newer version of adb.
[Raspberry Pi Development] trevd:
You want this one for the PI [ http://xdaforums.com/showthread.php?t=2047891 ] version 1.0.31 , it "should" work with 4.2.2 as the USB whitelisting was added to adb months ago. If it doesn't work let me know and I'll build a fresh one :D

Thanks
[Raspberry Pi Development] 5959823882589924:
Thank you, that one worked perfectly :)
[Raspberry Pi Development] 08BajaBoy:
I know this thread is really old and there is probably a tutorial out there. But, I feel like I am close to completing this on my own. I have ZERO linux experience. I am running the latest Raspbian version. I am stuck at "make install". I think I have properly downloaded the zip and extracted. Since a Makefile was supplied I skipped the "$ ./configure" step and went straight to "$ make". It popped up a few errors, missing bison and libncurses5-dev. Installed those and ran "$ make" again and got "Install: /out/host/linux-armv6l/bin" Then I tried "$ make install" again and received an output of "make: *** No rule to make target 'install'. Stop."

What am I missing? I tried changing directories to /home/pi/mypart/out/host/linux-armv6l/bin. I tried running the "make install" as root. Looking for a little direction. Thanks in advance.
[Raspberry Pi Development] steentje3:
Nice.
[Raspberry Pi Development] 5ft24:
You have to run the configure... it sets up the makefiles with the proper compiler flags and finds all the libraries not included in the source that are part of the Linux distribution itself. It will also let you know if any of the distro software is missing needed libraries, or if they are the wrong version.
[Raspberry Pi Development] 08BajaBoy:
Thanks for the reply [MENTION=3989612]5ft24[/MENTION]. Just for my own education, why was the makefile supplied if everyone has to run the config anyways?
[Raspberry Pi Development] 5ft24:
Included makefiles are generic. The configure finds the actual paths of things, tests for vertain libraries etc. And creates a makefile specific for the device it's on.
[Raspberry Pi Development] 08BajaBoy:
Stuck again...so I went back and tried to run ./configure and got "-bash: ./configure: No such file or directory". So went through several trials and came to conclusion that I needed to add deb-src to my sources.list. I ran make again (with root from /home/pi/mypart) and got a whole list of things I dont understand. I didn't get any failures or unknowns so it seemed to work correctly. I then tried to run ./configure again and got the same thing. I feel like I am missing something so simple like changing to another directory. But I do not know which one. I read many suggestions to read the readme file but I cant find that either. where do I go from here [MENTION=3989612]5ft24[/MENTION]?
[Raspberry Pi Development] 5ft24:
Once configure has run without errors, then just run make. It will then take the info configure modified and compile.
[Raspberry Pi Development] 08BajaBoy:
so once i have the file extracted. I do ./configure (I am assuming from /home/pi/mypart/) then make then makefile?
[Raspberry Pi Development] 5ft24:
Just ./configure, when it's done just make

And it is done
[Raspberry Pi Development] TomRiddl3:
what am i doing wrong??

im a noob.. .. trying to get adb working on my rpi to control a tablet ...

started with a clean install of raspbian ... apt-get update / apt-get upgrade etc etc..

downloaded the file "adbarmv6.7z" .. extracted everything to /home/pi/mypart/

cd /home/pi/mypart/

./configure.. but it wont go.. "no such file or directory"

am i in the wrong directory???

:confused::confused: i know it might be a dumb question obviously i am... but where should the command be run??

thanks for your time
[Raspberry Pi Development] phan1024:
If you still having problems, you can use the binary attached in this post. I confirmed it works with android 4.2, 4.4.
[Raspberry Pi Development] jogco:
Thanks!

This is a gem! Now I don't have to worry about what was going to be my next step - it 's already there. :D
[Raspberry Pi Development] Icon000:
Monkeyrunner too?

I was just curious since I know ADB can do monkeyrunner has anyone tired getting the raspberry pi to run a monkeyrunner script too? Maybe even with multiple devices?

Side Question: For multiple device do they need to be the same device, ie screen size? How do you tackle different screen sizes?
[Raspberry Pi Development] BubbleCow:
Thank you!

Worked for me on Raspbian, i just had to change one line:

LIBS= -lrt -lpthread -lssl

to

LIBS= -lrt -lpthread -lcrypto -lssl

This script did not work for me on Raspbian (ARM), but i do not have the exact errors on this computer :crying:
[Raspberry Pi Development] tm05504n:
Hi all of you. I am sorry for this question but can anybody tell me in simple easy steps that how i can download adb on raspberry . Thank you

in advance.
[Raspberry Pi Development] Icon000:
I have been looking for this answer too. I haven't been able to find an answer yet either. I've tried some of the terminal commands but nothing seems to be working right now. Have you had better luck?
[Raspberry Pi Development] jonny789:
Download binary of adb for pi, give '+x ' permission to that file .

Now use it.

e.g > ./adb --help

> ./adb shell

> ./adb devices
[Raspberry Pi Development] Icon000:
When you say download the binary you are talking about the adbarmv6.7z file correct?

I have been able to get that on to the pi but then I don't what to do with it. Am I giving the file '+x', which I assume means write permission via the terminal or can I use the gui? As far as the use it part I'm assume the lack of file directory means that I should use cd to get to the location of adbarmv6.7z? I know .7z is compressed file. Do I need to decompress it or anything?

Sorry for the late replay, work and life, and thanks for the help. After this wave of question I feel like I should be able to get this up and running on my own.
[Raspberry Pi Development] twig123:
Can someone please give me a step-by-step that 'nix n00b could follow on how to get the latest ADB working on the Pi?

The "adbarmv6.7z" version appears to be old, and just tells me that the device is offline.
[Raspberry Pi Development] A1AV8R:
I'm having the same issues. The old binary tells me all my devices are offline. I have tried the various compilation methods and none of them succeed. I'm not good enough with makefiles and building from source to work out the errors.
[Raspberry Pi Development] yashrs:
Same here bro. It would be great if someone in this community could compile the latest adb version for all. :)
[Raspberry Pi Development] ynk:
I couldnt find any clean info so i finally compiled one for arm6 (rpi1) available here https://dl.dropboxusercontent.com/u/736461/adb

Enjoy :)
[Raspberry Pi Development] Icon000:
Do you know what I would need to do to get monkey runner to work on the RPi?
[Raspberry Pi Development] ynk:
nope sorry... As monkeyrunner programs are made of Java, i'm guessing jdk and the java runtime would be a good start.
[Raspberry Pi Development] Ksiynder:
Very interesting!
[Raspberry Pi Development] shusain93:
I think I've found an issue.

So my current setup has three android devices hooked up to a Pi which executes ADB automation for hours on end. However, multiple times a day the Pi randomly freezes up and all the lights on the board go out except the power LED. I would suspect that it was the board having issues, EXCEPT I found that if I unplug a certain device it reboots automatically. I've tried looking in the system and kernel logs and there's nothing interesting up to the crash. I can not for the life of me figure out what's causing this. Right now I'm just running a programmable outlet that reboots it every hour which is stupid that I need to do it.
[Raspberry Pi Development] Icon000:
I've tried downloading the jdk directly to the raspberry pi but I don't know if it is downloading it in the correct place in for monkeyrunner to find it. Any suggestions?
[Raspberry Pi Development] 1619415:
I am currently TRYING to make a full dev computer with the following:

Pi 2 (B+)

Monitor

Keyboard + Mouse

Ubuntu Mate 15.04

A .sh script (to install all of the files needed for this too work, Java and a few programs that Google recommend)

Some files I found here on XDA

My goal is to have a cheap computer that you can package ROMs, Modify build.prop & installer scripts, use the latest ADB and Fastboot (10.0.32). If you would like to help, please send me a message on hangouts (chrislevine24@gmail.com). I'm currently still testing but REALLY need help making this proccess as SIMPLE as possible rather then having to do a TON of stuff

-1619415
[Raspberry Pi Development] Mikaël Restoux:
In case someone needs it, here is a build of adb 5.1.1 on ARMv7 (RPi 2B) : https://github.com/DeepSilence/adb-arm

I have not really tested it, the 'reverse' function is the only one I need..
[Raspberry Pi Development] Megadave123:

Any chance you have (or can build) adb 1.0.32 for rPi? (The new one that supports the "reverse" command)

I've been trying to cross-compile one but getting nothing but headaches and brick walls.


Actually, cancel that. I just found a newer post here that links to one.
[Raspberry Pi Development] josby:
Anyone have thoughts on compiling adb from the 6.0 branch of android? That is, there seems to be an adb 1.0.32 from the 5.1 branch but also a 1.0.32 from the 6.0 branch. The only visual difference seems to be that when you run "adb version", the 5.1 just gives "Android Debug Bridge version 1.0.32" but the 6.0 one gives "Android Debug Bridge version 1.0.32 / Revision d15680a64678-android"

I ask because I have Windows binaries of both and my phone (Blackberry Priv) is only recognized by the one from the 6.0 branch. So I can't use my phone with my Pi because the only adb binaries I can find for Pi are from the 5.1 branch.

I even found a download/build script at https://github.com/bonnyfone/adb-arm and was able to build adb myself from the latest 5.1.1 r36 but it still doesn't see my Priv.

I hoped I could just adapt that build script to do the 6.0 branch, but it looks like they switched from C to C++ so it's totally different and I'm way over my head on figuring out how to create my own make files for this. Any help would be appreciated