Building ADB and Fastboot results in huge binaries

258 views
Skip to first unread message

Noah Andrews

unread,
Jan 19, 2022, 9:25:09 PM1/19/22
to Android Building
 When I build ADB and Fastboot for Windows, I get binaries that are many times larger than the binaries available for download from Google. Specifically, ADB is 67.3 MiB (compared to just 5.66 MiB), and fastboot is 13.1 MiB (compared to just 1.55 MiB).

My build steps:

repo init -u https://android.googlesource.com/platform/manifest -b platform-tools-31.0.3
repo sync -j10
lunch sdk-user
make host_cross_adb
make host_cross_fastboot

I've also tried running make sdk before make host_cross_adb and make host_cross_fastboot, and originally I ran lunch sdk-eng like the instructions specify, and nothing seems to help.

Any assistance would be appreciated.

Dan Willemsen

unread,
Jan 19, 2022, 9:42:09 PM1/19/22
to android-...@googlegroups.com
You can build the entire platform-tools package for linux and windows with something like m dist sdk-repo-platform-tools on the master branch (and an upcoming platform-tools tag, but I don't think that one -- while there is an equivalent command, it's a much much much larger build, so I wouldn't recommend it).

The major missing piece between the binaries that you're building and what you see being distributed is calling `strip` on the binaries. On master that execution is `prebuilts/clang/host/linux-x86/clang-r437112b/bin/llvm-strip <path/to/adb.exe>`, but it may be slightly different on the particular tag you are using (different clang version / using `strip` instead of `llvm-strip` / etc).

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/caac19ec-8c41-4a40-b944-c303e5f0b212n%40googlegroups.com.

enh

unread,
Jan 19, 2022, 9:43:40 PM1/19/22
to android-...@googlegroups.com
the CI server has large binaries too:
https://ci.android.com/builds/submitted/8096863/aosp_arm64-userdebug/latest

and so do i locally:
-rwxr-x--- 1 enh primarygroup 67654656 Jan 19 18:28
out/host/windows-x86/bin/adb.exe

but if i run strip on it:
-rwxr-x--- 1 enh primarygroup 5974528 Jan 19 18:31
out/host/windows-x86/bin/adb.exe

seems to match what you're seeing.

On Wed, Jan 19, 2022 at 6:25 PM Noah Andrews <no...@revrobotics.com> wrote:
>

Noah Andrews

unread,
Jan 20, 2022, 4:25:10 PM1/20/22
to Android Building
Thank you both, that was definitely what I was missing.
Reply all
Reply to author
Forward
0 new messages