为arm处理器构建android adb

时间:2011-05-05 22:17:56

标签: android-ndk

我想在ARM平台上使用Android ADB工具。构建脚本中的一个命令是:

arm-eabi-g++
-I build/libs/host/include/host
-I build/libs/host/include
-I build/libs/host
-I out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates 
-I dalvik/libnativehelper/include/nativehelper
-I system/core/include
-I hardware/libhardware/include
-I hardware/libhardware_legacy/include
-I hardware/ril/include
-I dalvik/libnativehelper/include
-I frameworks/base/include
-I frameworks/base/opengl/include
-I frameworks/base/native/include
-I external/skia/include
-I tools/include
-I out/host/linux-arm/obj/include
-I prebuilt/ndk/android-ndk-r5b/platforms/android-9/arch-arm/usr/include
-c -fno-exceptions -Wno-multichar -fPIC
-include system/core/include/arch/linux-arm/AndroidConfig.h
-D_FORTIFY_SOURCE=0
-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG
-DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -DNDEBUG -UDEBUG
-MD -o out/host/linux-arm/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o   
build/libs/host/pseudolocalize.cpp

我确保安装了最新的ndk-r5b,这应该可以解决STL问题。但是,我仍然收到以下错误:

In file included from build/libs/host/pseudolocalize.cpp:1:
build/libs/host/include/host/pseudolocalize.h:4:18: error: string: No such file or directory
In file included from build/libs/host/pseudolocalize.cpp:1:
build/libs/host/include/host/pseudolocalize.h:6: error: 'string' in namespace 'std' does not name a type
build/libs/host/pseudolocalize.cpp: In function 'const char* pseudolocalize_char(char)':
build/libs/host/pseudolocalize.cpp:61: error: 'NULL' was not declared in this scope
build/libs/host/pseudolocalize.cpp: At global scope:
build/libs/host/pseudolocalize.cpp:71: error: 'string' does not name a type

有谁知道如何解决这个问题?顺便说一句,通过以下链接构建英特尔版本的adb可以正常工作:

http://lackingrhoticity.blogspot.com/2010/02/how-to-build-adb-android-debugger.html

3 个答案:

答案 0 :(得分:6)

adb不需要

pseudolocalize.cpp。 NDK工具链旨在用仿生(Android libc)构建。 adb需要glibc(GNU libc)来构建。

我创建了一个Makefile来为Linux / ARM编译adb。这个Makefile为Linux / ARM提供静态链接的adb可执行二进制文件,因此它也适用于Android / ARM。

如何制作。

  1. 安装Sourcery G++ Lite for ARM和GNU Make。
  2. 下载“Android source code”。
  3. Makefile保存为system / core / adb / Makefile。
  4. cd system / core / adb;使

答案 1 :(得分:1)

如果您需要为ARM构建 ADB 版本1.0.31 ),请查看here

存储库包含一体化构建脚本以及 ARM的预编译二进制文件

答案 2 :(得分:0)

我看到这个帖子已经很老了,无论如何它帮助了我。 我没找到

  

"用于ARM和GNU Make的Sourcery G ++ Lite。"

但是按照gcc 4的其他步骤设法构建/运行/为我的ARMv7:4.6.3-1ubuntu5

  1. N / A
  2. 下载" Android源代码"。
  3. 将Makefile另存为system / core / adb / Makefile。 3B。将Makefile编辑为CC = gcc和LD = gcc
  4. cd system / core / adb;使