如何从源代码构建 Android 的 adb? [英] How to build Android's adb from source code?

查看:50
本文介绍了如何从源代码构建 Android 的 adb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从源代码构建 Android 的 adb,我从 here一>.

I'm trying to build Android's adb from source code, which I downloaded from here.

我尝试使用 NDK21 和它的 ndk-build,但是遇到了这个错误

I tried to use NDK21 and its ndk-build, but got this error

Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.
Android NDK: Trying to define local module 'adbd' in C:\Users\...\adb/jni/Android.mk.
Android NDK: But this module was already defined by C:\Users\...\adb/jni/Android.mk.
C:/Users/.../android-ndk-r21d-windows-x86_64/android-ndk-r21d/build//../build/core/build-module.mk:34: *** Android NDK: Aborting.    .  Stop.

我发现 这个关于stackoverflow的问题与类似的问题,并试图从那里应用答案.从这里下载了 NDK7 的补丁版本并尝试用它构建 adb,但仍然有类似的错误

I have found this question on stackoverflow with the similar problem, and tried to apply the answer from there. Downloaded the patched version of NDK7 from here and tried to build adb with it, but still got a similar error

C:\Users\...\adb/jni/Android.mk:8: C:\Users\...\adb/jni/../platform_tools_tool_version.mk: No such file or directory
Android NDK: Trying to define local module 'adb' in C:\Users\...\adb/jni/Android.mk.
Android NDK: But this module was already defined by C:\Users\...\adb/jni/Android.mk.
C:/Users/.../android-ndk-r7b-master/android-ndk-r7b-master/build/core/build-module.mk:34: *** Android NDK: Aborting.    .  Stop.

尝试定义本地模块的所有其他解决方案...此模块已经定义 问题建议更改 Android.mk 文件,但我从原始来源获得它代码,所以我想它首先必须是正确的.

All other solutions for Trying to define local module ... this module was already defined problem advise to change Android.mk file, but I have it from original source code, so I suppose it must be correct in the first place.

我还可以尝试构建 adb 吗?

What else can I try to build adb?

提前致谢.

推荐答案

提到的项目是 AOSP 的一部分,应该在 AOSP build 中构建,但它似乎已经过时了,因为 AOSP master 现在正在使用这个:https://android.googlesource.com/platform/packages/模块/adb/+/refs/heads/master

The mentioned project is part of AOSP and should be built within AOSP build but it seems that it is already outdated because AOSP master is now using this one: https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/master

这篇关于如何从源代码构建 Android 的 adb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆