How to build adb(1.0.40) for windows on Ubuntu

Downloading the Source

Installing Repo

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Initializing a Repo client

repo init -u https://android.googlesource.com/platform/manifest

Downloading the Android source tree

repo sync

Preparing to Build

Set up environment

. build/envsetup.sh

Choose a target

lunch

Build the code

make host_cross_adb