让Android adb运行在ARM平台上

编程入门 行业动态 更新时间:2024-10-17 07:31:08

让Android adb运行在ARM<a href=https://www.elefans.com/category/jswz/34/1766364.html style=平台上"/>

让Android adb运行在ARM平台上

对android/system/core中的adb打上如下补丁:

From e8853dc01a99fddd57b375c29489cd817ddebc2d Mon Sep 17 00:00:00 2001
From: Barry Song <21cnbao@gmail>
Date: Wed, 2 May 2012 09:57:02 +0800
Subject: [PATCH] adb: make adb support arm as the host and adbd/host co-existThe Makefile is copied from 
with added DEFAULT_ADB_PORT=8888 to avoid the tcp port confliction
between adbd in client and cloned usb thread in host adbadbd uses 5037 port, thread in host adb uses 8888Signed-off-by: Barry Song <21cnbao@gmail>Change-Id: I70f178230a78f84ad464479abc2bba1fe6d2c372
---adb/Makefile |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++adb/adb.h    |    2 +2 files changed, 73 insertions(+), 0 deletions(-)create mode 100644 adb/Makefilediff --git a/adb/Makefile b/adb/Makefile
new file mode 100644
index 0000000..d5317ee
--- /dev/null
+++ b/adb/Makefile
@@ -0,0 +1,71 @@
+SRCS+= adb.c
+SRCS+= adb_client.c
+SRCS+= commandline.c
+SRCS+= console.c
+SRCS+= file_sync_client.c
+SRCS+= fdevent.c
+SRCS+= get_my_path_linux.c
+SRCS+= services.c
+SRCS+= sockets.c
+SRCS+= transport.c
+SRCS+= transport_local.c
+SRCS+= transport_usb.c
+SRCS+= usb_linux.c
+SRCS+= usb_vendors.c
+SRCS+= utils.c
+
+VPATH+= ../libcutils
+SRCS+= abort_socket.c
+SRCS+= socket_inaddr_any_server.c
+SRCS+= socket_local_client.c
+SRCS+= socket_local_server.c
+SRCS+= socket_loopback_client.c
+SRCS+= socket_loopback_server.c
+SRCS+= socket_network_client.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+VPATH+= ../../../external/zlib
+SRCS+= adler32.c
+SRCS+= compress.c
+SRCS+= crc32.c
+SRCS+= deflate.c
+SRCS+= infback.c
+SRCS+= inffast.c
+SRCS+= inflate.c
+SRCS+= inftrees.c
+SRCS+= trees.c
+SRCS+= uncompr.c
+SRCS+= zutil.c
+
+CPPFLAGS+= -DADB_HOST=1
+CPPFLAGS+= -DHAVE_FORKEXEC=1
+CPPFLAGS+= -DHAVE_SYMLINKS
+CPPFLAGS+= -DHAVE_TERMIO_H
+CPPFLAGS+= -D_GNU_SOURCE
+CPPFLAGS+= -D_XOPEN_SOURCE
+CPPFLAGS+= -DPATH_MAX=256
+CPPFLAGS+= -DDEFAULT_ADB_PORT=8888
+CPPFLAGS+= -I.
+CPPFLAGS+= -I../include
+CPPFLAGS+= -I../../../external/zlib
+
+CFLAGS+= -O2 -g -Wall -Wno-unused-parameter -DDEFAULT_ADB_PORT=8888
+LDFLAGS= -static
+LIBS= -lrt -lpthread
+
+TOOLCHAIN= arm-none-linux-gnueabi-
+CC= $(TOOLCHAIN)gcc
+LD= $(TOOLCHAIN)gcc
+
+OBJS= $(SRCS:.c=.o)
+
+all: adb
+
+adb: $(OBJS)
+$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
+
+clean:
+rm -rf $(OBJS)
diff --git a/adb/adb.h b/adb/adb.h
index f52c8b7..51b4c2f 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -365,7 +365,9 @@ typedef enum {#define print_packet(tag,p) do {} while (0)#endif+#ifndef DEFAULT_ADB_PORT#define DEFAULT_ADB_PORT 5037
+#endif#define DEFAULT_ADB_LOCAL_TRANSPORT_PORT 5555#define ADB_CLASS              0xff
-- 
1.7.0.4

在adb所在目录运行make,使用arm linux toolchain得到了adb。即可以在运行ARM Linux平台的电路板或Android手机上作为adb的host了。

更多推荐

让Android adb运行在ARM平台上

本文发布于:2024-02-12 01:03:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1684803.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平台上   Android   adb   ARM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!