为arm处理器构建android adb

use*_*678 4 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
Run Code Online (Sandbox Code Playgroud)

我已经确定安装了最新的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
Run Code Online (Sandbox Code Playgroud)

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

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

Kaz*_*oto 6

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

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

怎么做.

  1. 为ARM和GNU Make 安装Sourcery G ++ Lite.
  2. 下载" Android源代码 ".
  3. 将Makefile另存为system/core/adb/Makefile.
  4. cd system/core/adb; 使.